mastra 0.1.57-unstable.57 → 0.1.57-unstable.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/commands/create/create.d.ts +8 -0
  2. package/dist/commands/create/create.d.ts.map +1 -0
  3. package/dist/commands/create/create.js +35 -0
  4. package/dist/commands/create/utils.d.ts +4 -0
  5. package/dist/commands/create/utils.d.ts.map +1 -0
  6. package/dist/commands/create/utils.js +58 -0
  7. package/dist/commands/deploy/cloudflare/index.d.ts.map +1 -1
  8. package/dist/commands/deploy/cloudflare/index.js +2 -0
  9. package/dist/commands/deploy/netlify/index.d.ts.map +1 -1
  10. package/dist/commands/deploy/netlify/index.js +2 -0
  11. package/dist/commands/deploy/vercel/index.d.ts.map +1 -1
  12. package/dist/commands/deploy/vercel/index.js +2 -0
  13. package/dist/commands/dev.d.ts.map +1 -1
  14. package/dist/commands/dev.js +97 -10
  15. package/dist/commands/engine/down.d.ts +1 -1
  16. package/dist/commands/engine/down.d.ts.map +1 -1
  17. package/dist/commands/engine/down.js +3 -2
  18. package/dist/commands/engine/up.d.ts +1 -1
  19. package/dist/commands/engine/up.d.ts.map +1 -1
  20. package/dist/commands/engine/up.js +3 -2
  21. package/dist/commands/init/init.d.ts +2 -2
  22. package/dist/commands/init/init.d.ts.map +1 -1
  23. package/dist/commands/init/init.js +33 -9
  24. package/dist/commands/init/utils.d.ts +21 -9
  25. package/dist/commands/init/utils.d.ts.map +1 -1
  26. package/dist/commands/init/utils.js +64 -74
  27. package/dist/index.d.ts +2 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +54 -56
  30. package/dist/services/service.deps.d.ts +1 -0
  31. package/dist/services/service.deps.d.ts.map +1 -1
  32. package/dist/services/service.deps.js +8 -0
  33. package/dist/services/service.docker.d.ts +1 -0
  34. package/dist/services/service.docker.d.ts.map +1 -1
  35. package/dist/services/service.docker.js +20 -0
  36. package/dist/src/starter-files/config.ts +28 -0
  37. package/dist/src/starter-files/mastra-pg.docker-compose.yaml +15 -0
  38. package/dist/src/starter-files/tools.ts +95 -0
  39. package/dist/src/starter-files/workflow.ts +173 -0
  40. package/dist/templates/express-server.d.ts.map +1 -1
  41. package/dist/templates/express-server.js +30 -31
  42. package/dist/templates/netlify.d.ts.map +1 -1
  43. package/dist/templates/netlify.js +199 -34
  44. package/dist/templates/worker.d.ts.map +1 -1
  45. package/dist/templates/worker.js +255 -35
  46. package/dist/utils/bundle.d.ts +1 -0
  47. package/dist/utils/bundle.d.ts.map +1 -1
  48. package/dist/utils/bundle.js +8 -8
  49. package/package.json +5 -3
  50. package/src/playground/dist/assets/{hcl-Cztwc-HH.js → hcl-_Zu0RE-q.js} +1 -1
  51. package/src/playground/dist/assets/index-BiEU7Tmg.js +389 -0
  52. package/src/playground/dist/assets/{index-Dx4A5Op9.js → index-Cke4BidO.js} +2 -2
  53. package/src/playground/dist/assets/{vue-html-x3hEOujm.js → vue-html-59TQSa_j.js} +1 -1
  54. package/src/playground/dist/assets/vue-srE0XGv_.js +1 -0
  55. package/src/playground/dist/index.html +1 -1
  56. package/src/starter-files/tools.ts +88 -14
  57. package/src/starter-files/workflow.ts +160 -21
  58. package/src/playground/dist/assets/index-DY22QVI1.js +0 -389
  59. package/src/playground/dist/assets/vue-xldAUJov.js +0 -1
  60. package/src/starter-files/api.ts +0 -11
  61. package/src/starter-files/framework-utils.ts +0 -33
@@ -0,0 +1,389 @@
1
+ var Xz=Object.defineProperty;var Qz=(e,t,n)=>t in e?Xz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var un=(e,t,n)=>Qz(e,typeof t!="symbol"?t+"":t,n);function Jz(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function Zl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xy={exports:{}},Gu={},Qy={exports:{}},ht={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var aC;function e$(){if(aC)return ht;aC=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;function p(U){return U===null||typeof U!="object"?null:(U=h&&U[h]||U["@@iterator"],typeof U=="function"?U:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,x={};function k(U,V,D){this.props=U,this.context=V,this.refs=x,this.updater=D||m}k.prototype.isReactComponent={},k.prototype.setState=function(U,V){if(typeof U!="object"&&typeof U!="function"&&U!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,U,V,"setState")},k.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function w(){}w.prototype=k.prototype;function E(U,V,D){this.props=U,this.context=V,this.refs=x,this.updater=D||m}var C=E.prototype=new w;C.constructor=E,y(C,k.prototype),C.isPureReactComponent=!0;var N=Array.isArray,P=Object.prototype.hasOwnProperty,A={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function M(U,V,D){var G,K={},J=null,ee=null;if(V!=null)for(G in V.ref!==void 0&&(ee=V.ref),V.key!==void 0&&(J=""+V.key),V)P.call(V,G)&&!O.hasOwnProperty(G)&&(K[G]=V[G]);var re=arguments.length-2;if(re===1)K.children=D;else if(1<re){for(var ue=Array(re),he=0;he<re;he++)ue[he]=arguments[he+2];K.children=ue}if(U&&U.defaultProps)for(G in re=U.defaultProps,re)K[G]===void 0&&(K[G]=re[G]);return{$$typeof:e,type:U,key:J,ref:ee,props:K,_owner:A.current}}function j(U,V){return{$$typeof:e,type:U.type,key:V,ref:U.ref,props:U.props,_owner:U._owner}}function R(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function $(U){var V={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(D){return V[D]})}var F=/\/+/g;function H(U,V){return typeof U=="object"&&U!==null&&U.key!=null?$(""+U.key):V.toString(36)}function I(U,V,D,G,K){var J=typeof U;(J==="undefined"||J==="boolean")&&(U=null);var ee=!1;if(U===null)ee=!0;else switch(J){case"string":case"number":ee=!0;break;case"object":switch(U.$$typeof){case e:case t:ee=!0}}if(ee)return ee=U,K=K(ee),U=G===""?"."+H(ee,0):G,N(K)?(D="",U!=null&&(D=U.replace(F,"$&/")+"/"),I(K,V,D,"",function(he){return he})):K!=null&&(R(K)&&(K=j(K,D+(!K.key||ee&&ee.key===K.key?"":(""+K.key).replace(F,"$&/")+"/")+U)),V.push(K)),1;if(ee=0,G=G===""?".":G+":",N(U))for(var re=0;re<U.length;re++){J=U[re];var ue=G+H(J,re);ee+=I(J,V,D,ue,K)}else if(ue=p(U),typeof ue=="function")for(U=ue.call(U),re=0;!(J=U.next()).done;)J=J.value,ue=G+H(J,re++),ee+=I(J,V,D,ue,K);else if(J==="object")throw V=String(U),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.");return ee}function Y(U,V,D){if(U==null)return U;var G=[],K=0;return I(U,G,"","",function(J){return V.call(D,J,K++)}),G}function q(U){if(U._status===-1){var V=U._result;V=V(),V.then(function(D){(U._status===0||U._status===-1)&&(U._status=1,U._result=D)},function(D){(U._status===0||U._status===-1)&&(U._status=2,U._result=D)}),U._status===-1&&(U._status=0,U._result=V)}if(U._status===1)return U._result.default;throw U._result}var Z={current:null},B={transition:null},W={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:B,ReactCurrentOwner:A};function L(){throw Error("act(...) is not supported in production builds of React.")}return ht.Children={map:Y,forEach:function(U,V,D){Y(U,function(){V.apply(this,arguments)},D)},count:function(U){var V=0;return Y(U,function(){V++}),V},toArray:function(U){return Y(U,function(V){return V})||[]},only:function(U){if(!R(U))throw Error("React.Children.only expected to receive a single React element child.");return U}},ht.Component=k,ht.Fragment=n,ht.Profiler=i,ht.PureComponent=E,ht.StrictMode=r,ht.Suspense=u,ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W,ht.act=L,ht.cloneElement=function(U,V,D){if(U==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+U+".");var G=y({},U.props),K=U.key,J=U.ref,ee=U._owner;if(V!=null){if(V.ref!==void 0&&(J=V.ref,ee=A.current),V.key!==void 0&&(K=""+V.key),U.type&&U.type.defaultProps)var re=U.type.defaultProps;for(ue in V)P.call(V,ue)&&!O.hasOwnProperty(ue)&&(G[ue]=V[ue]===void 0&&re!==void 0?re[ue]:V[ue])}var ue=arguments.length-2;if(ue===1)G.children=D;else if(1<ue){re=Array(ue);for(var he=0;he<ue;he++)re[he]=arguments[he+2];G.children=re}return{$$typeof:e,type:U.type,key:K,ref:J,props:G,_owner:ee}},ht.createContext=function(U){return U={$$typeof:s,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},U.Provider={$$typeof:o,_context:U},U.Consumer=U},ht.createElement=M,ht.createFactory=function(U){var V=M.bind(null,U);return V.type=U,V},ht.createRef=function(){return{current:null}},ht.forwardRef=function(U){return{$$typeof:a,render:U}},ht.isValidElement=R,ht.lazy=function(U){return{$$typeof:f,_payload:{_status:-1,_result:U},_init:q}},ht.memo=function(U,V){return{$$typeof:c,type:U,compare:V===void 0?null:V}},ht.startTransition=function(U){var V=B.transition;B.transition={};try{U()}finally{B.transition=V}},ht.unstable_act=L,ht.useCallback=function(U,V){return Z.current.useCallback(U,V)},ht.useContext=function(U){return Z.current.useContext(U)},ht.useDebugValue=function(){},ht.useDeferredValue=function(U){return Z.current.useDeferredValue(U)},ht.useEffect=function(U,V){return Z.current.useEffect(U,V)},ht.useId=function(){return Z.current.useId()},ht.useImperativeHandle=function(U,V,D){return Z.current.useImperativeHandle(U,V,D)},ht.useInsertionEffect=function(U,V){return Z.current.useInsertionEffect(U,V)},ht.useLayoutEffect=function(U,V){return Z.current.useLayoutEffect(U,V)},ht.useMemo=function(U,V){return Z.current.useMemo(U,V)},ht.useReducer=function(U,V,D){return Z.current.useReducer(U,V,D)},ht.useRef=function(U){return Z.current.useRef(U)},ht.useState=function(U){return Z.current.useState(U)},ht.useSyncExternalStore=function(U,V,D){return Z.current.useSyncExternalStore(U,V,D)},ht.useTransition=function(){return Z.current.useTransition()},ht.version="18.3.1",ht}var lC;function Kl(){return lC||(lC=1,Qy.exports=e$()),Qy.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var uC;function t$(){if(uC)return Gu;uC=1;var e=Kl(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,u,c){var f,h={},p=null,m=null;c!==void 0&&(p=""+c),u.key!==void 0&&(p=""+u.key),u.ref!==void 0&&(m=u.ref);for(f in u)r.call(u,f)&&!o.hasOwnProperty(f)&&(h[f]=u[f]);if(a&&a.defaultProps)for(f in u=a.defaultProps,u)h[f]===void 0&&(h[f]=u[f]);return{$$typeof:t,type:a,key:p,ref:m,props:h,_owner:i.current}}return Gu.Fragment=n,Gu.jsx=s,Gu.jsxs=s,Gu}var cC;function n$(){return cC||(cC=1,Xy.exports=t$()),Xy.exports}var v=n$(),S=Kl();const ne=Zl(S),r$=Jz({__proto__:null,default:ne},[S]);var ph={},Jy={exports:{}},lr={},ev={exports:{}},tv={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var dC;function i$(){return dC||(dC=1,function(e){function t(B,W){var L=B.length;B.push(W);e:for(;0<L;){var U=L-1>>>1,V=B[U];if(0<i(V,W))B[U]=W,B[L]=V,L=U;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var W=B[0],L=B.pop();if(L!==W){B[0]=L;e:for(var U=0,V=B.length,D=V>>>1;U<D;){var G=2*(U+1)-1,K=B[G],J=G+1,ee=B[J];if(0>i(K,L))J<V&&0>i(ee,K)?(B[U]=ee,B[J]=L,U=J):(B[U]=K,B[G]=L,U=G);else if(J<V&&0>i(ee,L))B[U]=ee,B[J]=L,U=J;else break e}}return W}function i(B,W){var L=B.sortIndex-W.sortIndex;return L!==0?L:B.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var u=[],c=[],f=1,h=null,p=3,m=!1,y=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(B){for(var W=n(c);W!==null;){if(W.callback===null)r(c);else if(W.startTime<=B)r(c),W.sortIndex=W.expirationTime,t(u,W);else break;W=n(c)}}function N(B){if(x=!1,C(B),!y)if(n(u)!==null)y=!0,q(P);else{var W=n(c);W!==null&&Z(N,W.startTime-B)}}function P(B,W){y=!1,x&&(x=!1,w(M),M=-1),m=!0;var L=p;try{for(C(W),h=n(u);h!==null&&(!(h.expirationTime>W)||B&&!$());){var U=h.callback;if(typeof U=="function"){h.callback=null,p=h.priorityLevel;var V=U(h.expirationTime<=W);W=e.unstable_now(),typeof V=="function"?h.callback=V:h===n(u)&&r(u),C(W)}else r(u);h=n(u)}if(h!==null)var D=!0;else{var G=n(c);G!==null&&Z(N,G.startTime-W),D=!1}return D}finally{h=null,p=L,m=!1}}var A=!1,O=null,M=-1,j=5,R=-1;function $(){return!(e.unstable_now()-R<j)}function F(){if(O!==null){var B=e.unstable_now();R=B;var W=!0;try{W=O(!0,B)}finally{W?H():(A=!1,O=null)}}else A=!1}var H;if(typeof E=="function")H=function(){E(F)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,Y=I.port2;I.port1.onmessage=F,H=function(){Y.postMessage(null)}}else H=function(){k(F,0)};function q(B){O=B,A||(A=!0,H())}function Z(B,W){M=k(function(){B(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_continueExecution=function(){y||m||(y=!0,q(P))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(B){switch(p){case 1:case 2:case 3:var W=3;break;default:W=p}var L=p;p=W;try{return B()}finally{p=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,W){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var L=p;p=B;try{return W()}finally{p=L}},e.unstable_scheduleCallback=function(B,W,L){var U=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?U+L:U):L=U,B){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=L+V,B={id:f++,callback:W,priorityLevel:B,startTime:L,expirationTime:V,sortIndex:-1},L>U?(B.sortIndex=L,t(c,B),n(u)===null&&B===n(c)&&(x?(w(M),M=-1):x=!0,Z(N,L-U))):(B.sortIndex=V,t(u,B),y||m||(y=!0,q(P))),B},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(B){var W=p;return function(){var L=p;p=W;try{return B.apply(this,arguments)}finally{p=L}}}}(tv)),tv}var fC;function o$(){return fC||(fC=1,ev.exports=i$()),ev.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var hC;function s$(){if(hC)return lr;hC=1;var e=Kl(),t=o$();function n(l){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+l,g=1;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+l+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function o(l,d){s(l,d),s(l+"Capture",d)}function s(l,d){for(i[l]=d,l=0;l<d.length;l++)r.add(d[l])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,c=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},h={};function p(l){return u.call(h,l)?!0:u.call(f,l)?!1:c.test(l)?h[l]=!0:(f[l]=!0,!1)}function m(l,d,g,b){if(g!==null&&g.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return b?!1:g!==null?!g.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function y(l,d,g,b){if(d===null||typeof d>"u"||m(l,d,g,b))return!0;if(b)return!1;if(g!==null)switch(g.type){case 3:return!d;case 4:return d===!1;case 5:return isNaN(d);case 6:return isNaN(d)||1>d}return!1}function x(l,d,g,b,_,T,z){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=b,this.attributeNamespace=_,this.mustUseProperty=g,this.propertyName=l,this.type=d,this.sanitizeURL=T,this.removeEmptyString=z}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){k[l]=new x(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var d=l[0];k[d]=new x(d,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){k[l]=new x(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){k[l]=new x(l,2,!1,l,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(l){k[l]=new x(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){k[l]=new x(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){k[l]=new x(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){k[l]=new x(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){k[l]=new x(l,5,!1,l.toLowerCase(),null,!1,!1)});var w=/[\-:]([a-z])/g;function E(l){return l[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(l){var d=l.replace(w,E);k[d]=new x(d,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var d=l.replace(w,E);k[d]=new x(d,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var d=l.replace(w,E);k[d]=new x(d,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){k[l]=new x(l,1,!1,l.toLowerCase(),null,!1,!1)}),k.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){k[l]=new x(l,1,!1,l.toLowerCase(),null,!0,!0)});function C(l,d,g,b){var _=k.hasOwnProperty(d)?k[d]:null;(_!==null?_.type!==0:b||!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(y(d,g,_,b)&&(g=null),b||_===null?p(d)&&(g===null?l.removeAttribute(d):l.setAttribute(d,""+g)):_.mustUseProperty?l[_.propertyName]=g===null?_.type===3?!1:"":g:(d=_.attributeName,b=_.attributeNamespace,g===null?l.removeAttribute(d):(_=_.type,g=_===3||_===4&&g===!0?"":""+g,b?l.setAttributeNS(b,d,g):l.setAttribute(d,g))))}var N=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),A=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),$=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),Z=Symbol.for("react.offscreen"),B=Symbol.iterator;function W(l){return l===null||typeof l!="object"?null:(l=B&&l[B]||l["@@iterator"],typeof l=="function"?l:null)}var L=Object.assign,U;function V(l){if(U===void 0)try{throw Error()}catch(g){var d=g.stack.trim().match(/\n( *(at )?)/);U=d&&d[1]||""}return`
34
+ `+U+l}var D=!1;function G(l,d){if(!l||D)return"";D=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(de){var b=de}Reflect.construct(l,[],d)}else{try{d.call()}catch(de){b=de}l.call(d.prototype)}else{try{throw Error()}catch(de){b=de}l()}}catch(de){if(de&&b&&typeof de.stack=="string"){for(var _=de.stack.split(`
35
+ `),T=b.stack.split(`
36
+ `),z=_.length-1,X=T.length-1;1<=z&&0<=X&&_[z]!==T[X];)X--;for(;1<=z&&0<=X;z--,X--)if(_[z]!==T[X]){if(z!==1||X!==1)do if(z--,X--,0>X||_[z]!==T[X]){var te=`
37
+ `+_[z].replace(" at new "," at ");return l.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",l.displayName)),te}while(1<=z&&0<=X);break}}}finally{D=!1,Error.prepareStackTrace=g}return(l=l?l.displayName||l.name:"")?V(l):""}function K(l){switch(l.tag){case 5:return V(l.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return l=G(l.type,!1),l;case 11:return l=G(l.type.render,!1),l;case 1:return l=G(l.type,!0),l;default:return""}}function J(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case O:return"Fragment";case A:return"Portal";case j:return"Profiler";case M:return"StrictMode";case H:return"Suspense";case I:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case $:return(l.displayName||"Context")+".Consumer";case R:return(l._context.displayName||"Context")+".Provider";case F:var d=l.render;return l=l.displayName,l||(l=d.displayName||d.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Y:return d=l.displayName||null,d!==null?d:J(l.type)||"Memo";case q:d=l._payload,l=l._init;try{return J(l(d))}catch{}}return null}function ee(l){var d=l.type;switch(l.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=d.render,l=l.displayName||l.name||"",d.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return J(d);case 8:return d===M?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function re(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function ue(l){var d=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function he(l){var d=ue(l)?"checked":"value",g=Object.getOwnPropertyDescriptor(l.constructor.prototype,d),b=""+l[d];if(!l.hasOwnProperty(d)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var _=g.get,T=g.set;return Object.defineProperty(l,d,{configurable:!0,get:function(){return _.call(this)},set:function(z){b=""+z,T.call(this,z)}}),Object.defineProperty(l,d,{enumerable:g.enumerable}),{getValue:function(){return b},setValue:function(z){b=""+z},stopTracking:function(){l._valueTracker=null,delete l[d]}}}}function be(l){l._valueTracker||(l._valueTracker=he(l))}function fe(l){if(!l)return!1;var d=l._valueTracker;if(!d)return!0;var g=d.getValue(),b="";return l&&(b=ue(l)?l.checked?"true":"false":l.value),l=b,l!==g?(d.setValue(l),!0):!1}function ve(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Me(l,d){var g=d.checked;return L({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:g??l._wrapperState.initialChecked})}function $e(l,d){var g=d.defaultValue==null?"":d.defaultValue,b=d.checked!=null?d.checked:d.defaultChecked;g=re(d.value!=null?d.value:g),l._wrapperState={initialChecked:b,initialValue:g,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function ct(l,d){d=d.checked,d!=null&&C(l,"checked",d,!1)}function _t(l,d){ct(l,d);var g=re(d.value),b=d.type;if(g!=null)b==="number"?(g===0&&l.value===""||l.value!=g)&&(l.value=""+g):l.value!==""+g&&(l.value=""+g);else if(b==="submit"||b==="reset"){l.removeAttribute("value");return}d.hasOwnProperty("value")?oe(l,d.type,g):d.hasOwnProperty("defaultValue")&&oe(l,d.type,re(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(l.defaultChecked=!!d.defaultChecked)}function Q(l,d,g){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var b=d.type;if(!(b!=="submit"&&b!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+l._wrapperState.initialValue,g||d===l.value||(l.value=d),l.defaultValue=d}g=l.name,g!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,g!==""&&(l.name=g)}function oe(l,d,g){(d!=="number"||ve(l.ownerDocument)!==l)&&(g==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+g&&(l.defaultValue=""+g))}var ae=Array.isArray;function Ce(l,d,g,b){if(l=l.options,d){d={};for(var _=0;_<g.length;_++)d["$"+g[_]]=!0;for(g=0;g<l.length;g++)_=d.hasOwnProperty("$"+l[g].value),l[g].selected!==_&&(l[g].selected=_),_&&b&&(l[g].defaultSelected=!0)}else{for(g=""+re(g),d=null,_=0;_<l.length;_++){if(l[_].value===g){l[_].selected=!0,b&&(l[_].defaultSelected=!0);return}d!==null||l[_].disabled||(d=l[_])}d!==null&&(d.selected=!0)}}function ke(l,d){if(d.dangerouslySetInnerHTML!=null)throw Error(n(91));return L({},d,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function ge(l,d){var g=d.value;if(g==null){if(g=d.children,d=d.defaultValue,g!=null){if(d!=null)throw Error(n(92));if(ae(g)){if(1<g.length)throw Error(n(93));g=g[0]}d=g}d==null&&(d=""),g=d}l._wrapperState={initialValue:re(g)}}function Ae(l,d){var g=re(d.value),b=re(d.defaultValue);g!=null&&(g=""+g,g!==l.value&&(l.value=g),d.defaultValue==null&&l.defaultValue!==g&&(l.defaultValue=g)),b!=null&&(l.defaultValue=""+b)}function Fe(l){var d=l.textContent;d===l._wrapperState.initialValue&&d!==""&&d!==null&&(l.value=d)}function ce(l){switch(l){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pe(l,d){return l==null||l==="http://www.w3.org/1999/xhtml"?ce(d):l==="http://www.w3.org/2000/svg"&&d==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Ie,Ke=function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(d,g,b,_){MSApp.execUnsafeLocalFunction(function(){return l(d,g,b,_)})}:l}(function(l,d){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=d;else{for(Ie=Ie||document.createElement("div"),Ie.innerHTML="<svg>"+d.valueOf().toString()+"</svg>",d=Ie.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;d.firstChild;)l.appendChild(d.firstChild)}});function tt(l,d){if(d){var g=l.firstChild;if(g&&g===l.lastChild&&g.nodeType===3){g.nodeValue=d;return}}l.textContent=d}var At={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},He=["Webkit","ms","Moz","O"];Object.keys(At).forEach(function(l){He.forEach(function(d){d=d+l.charAt(0).toUpperCase()+l.substring(1),At[d]=At[l]})});function it(l,d,g){return d==null||typeof d=="boolean"||d===""?"":g||typeof d!="number"||d===0||At.hasOwnProperty(l)&&At[l]?(""+d).trim():d+"px"}function at(l,d){l=l.style;for(var g in d)if(d.hasOwnProperty(g)){var b=g.indexOf("--")===0,_=it(g,d[g],b);g==="float"&&(g="cssFloat"),b?l.setProperty(g,_):l[g]=_}}var Wt=L({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yt(l,d){if(d){if(Wt[l]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(n(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(n(61))}if(d.style!=null&&typeof d.style!="object")throw Error(n(62))}}function yn(l,d){if(l.indexOf("-")===-1)return typeof d.is=="string";switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gt=null;function jt(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var ft=null,Ye=null,dt=null;function Ct(l){if(l=Du(l)){if(typeof ft!="function")throw Error(n(280));var d=l.stateNode;d&&(d=Af(d),ft(l.stateNode,l.type,d))}}function rn(l){Ye?dt?dt.push(l):dt=[l]:Ye=l}function vn(){if(Ye){var l=Ye,d=dt;if(dt=Ye=null,Ct(l),d)for(l=0;l<d.length;l++)Ct(d[l])}}function Yi(l,d){return l(d)}function Sa(){}var du=!1;function rf(l,d,g){if(du)return l(d,g);du=!0;try{return Yi(l,d,g)}finally{du=!1,(Ye!==null||dt!==null)&&(Sa(),vn())}}function As(l,d){var g=l.stateNode;if(g===null)return null;var b=Af(g);if(b===null)return null;g=b[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(b=!b.disabled)||(l=l.type,b=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!b;break e;default:l=!1}if(l)return null;if(g&&typeof g!="function")throw Error(n(231,d,typeof g));return g}var fu=!1;if(a)try{var Ps={};Object.defineProperty(Ps,"passive",{get:function(){fu=!0}}),window.addEventListener("test",Ps,Ps),window.removeEventListener("test",Ps,Ps)}catch{fu=!1}function ag(l,d,g,b,_,T,z,X,te){var de=Array.prototype.slice.call(arguments,3);try{d.apply(g,de)}catch(xe){this.onError(xe)}}var Rs=!1,Ea=null,Ca=!1,hu=null,lg={onError:function(l){Rs=!0,Ea=l}};function ug(l,d,g,b,_,T,z,X,te){Rs=!1,Ea=null,ag.apply(lg,arguments)}function of(l,d,g,b,_,T,z,X,te){if(ug.apply(this,arguments),Rs){if(Rs){var de=Ea;Rs=!1,Ea=null}else throw Error(n(198));Ca||(Ca=!0,hu=de)}}function vi(l){var d=l,g=l;if(l.alternate)for(;d.return;)d=d.return;else{l=d;do d=l,d.flags&4098&&(g=d.return),l=d.return;while(l)}return d.tag===3?g:null}function sf(l){if(l.tag===13){var d=l.memoizedState;if(d===null&&(l=l.alternate,l!==null&&(d=l.memoizedState)),d!==null)return d.dehydrated}return null}function af(l){if(vi(l)!==l)throw Error(n(188))}function cg(l){var d=l.alternate;if(!d){if(d=vi(l),d===null)throw Error(n(188));return d!==l?null:l}for(var g=l,b=d;;){var _=g.return;if(_===null)break;var T=_.alternate;if(T===null){if(b=_.return,b!==null){g=b;continue}break}if(_.child===T.child){for(T=_.child;T;){if(T===g)return af(_),l;if(T===b)return af(_),d;T=T.sibling}throw Error(n(188))}if(g.return!==b.return)g=_,b=T;else{for(var z=!1,X=_.child;X;){if(X===g){z=!0,g=_,b=T;break}if(X===b){z=!0,b=_,g=T;break}X=X.sibling}if(!z){for(X=T.child;X;){if(X===g){z=!0,g=T,b=_;break}if(X===b){z=!0,b=T,g=_;break}X=X.sibling}if(!z)throw Error(n(189))}}if(g.alternate!==b)throw Error(n(190))}if(g.tag!==3)throw Error(n(188));return g.stateNode.current===g?l:d}function lf(l){return l=cg(l),l!==null?uf(l):null}function uf(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var d=uf(l);if(d!==null)return d;l=l.sibling}return null}var cf=t.unstable_scheduleCallback,df=t.unstable_cancelCallback,ff=t.unstable_shouldYield,dg=t.unstable_requestPaint,Gt=t.unstable_now,fg=t.unstable_getCurrentPriorityLevel,pu=t.unstable_ImmediatePriority,hf=t.unstable_UserBlockingPriority,_a=t.unstable_NormalPriority,hg=t.unstable_LowPriority,mu=t.unstable_IdlePriority,Na=null,Mr=null;function pg(l){if(Mr&&typeof Mr.onCommitFiberRoot=="function")try{Mr.onCommitFiberRoot(Na,l,void 0,(l.current.flags&128)===128)}catch{}}var pr=Math.clz32?Math.clz32:yg,mg=Math.log,gg=Math.LN2;function yg(l){return l>>>=0,l===0?32:31-(mg(l)/gg|0)|0}var Ta=64,Aa=4194304;function qi(l){switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Pa(l,d){var g=l.pendingLanes;if(g===0)return 0;var b=0,_=l.suspendedLanes,T=l.pingedLanes,z=g&268435455;if(z!==0){var X=z&~_;X!==0?b=qi(X):(T&=z,T!==0&&(b=qi(T)))}else z=g&~_,z!==0?b=qi(z):T!==0&&(b=qi(T));if(b===0)return 0;if(d!==0&&d!==b&&!(d&_)&&(_=b&-b,T=d&-d,_>=T||_===16&&(T&4194240)!==0))return d;if(b&4&&(b|=g&16),d=l.entangledLanes,d!==0)for(l=l.entanglements,d&=b;0<d;)g=31-pr(d),_=1<<g,b|=l[g],d&=~_;return b}function y3(l,d){switch(l){case 1:case 2:case 4:return d+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function v3(l,d){for(var g=l.suspendedLanes,b=l.pingedLanes,_=l.expirationTimes,T=l.pendingLanes;0<T;){var z=31-pr(T),X=1<<z,te=_[z];te===-1?(!(X&g)||X&b)&&(_[z]=y3(X,d)):te<=d&&(l.expiredLanes|=X),T&=~X}}function vg(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function Fk(){var l=Ta;return Ta<<=1,!(Ta&4194240)&&(Ta=64),l}function xg(l){for(var d=[],g=0;31>g;g++)d.push(l);return d}function gu(l,d,g){l.pendingLanes|=d,d!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,d=31-pr(d),l[d]=g}function x3(l,d){var g=l.pendingLanes&~d;l.pendingLanes=d,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=d,l.mutableReadLanes&=d,l.entangledLanes&=d,d=l.entanglements;var b=l.eventTimes;for(l=l.expirationTimes;0<g;){var _=31-pr(g),T=1<<_;d[_]=0,b[_]=-1,l[_]=-1,g&=~T}}function wg(l,d){var g=l.entangledLanes|=d;for(l=l.entanglements;g;){var b=31-pr(g),_=1<<b;_&d|l[b]&d&&(l[b]|=d),g&=~_}}var Nt=0;function zk(l){return l&=-l,1<l?4<l?l&268435455?16:536870912:4:1}var $k,bg,Bk,Vk,Wk,kg=!1,pf=[],Mo=null,Do=null,Oo=null,yu=new Map,vu=new Map,Io=[],w3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Uk(l,d){switch(l){case"focusin":case"focusout":Mo=null;break;case"dragenter":case"dragleave":Do=null;break;case"mouseover":case"mouseout":Oo=null;break;case"pointerover":case"pointerout":yu.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":vu.delete(d.pointerId)}}function xu(l,d,g,b,_,T){return l===null||l.nativeEvent!==T?(l={blockedOn:d,domEventName:g,eventSystemFlags:b,nativeEvent:T,targetContainers:[_]},d!==null&&(d=Du(d),d!==null&&bg(d)),l):(l.eventSystemFlags|=b,d=l.targetContainers,_!==null&&d.indexOf(_)===-1&&d.push(_),l)}function b3(l,d,g,b,_){switch(d){case"focusin":return Mo=xu(Mo,l,d,g,b,_),!0;case"dragenter":return Do=xu(Do,l,d,g,b,_),!0;case"mouseover":return Oo=xu(Oo,l,d,g,b,_),!0;case"pointerover":var T=_.pointerId;return yu.set(T,xu(yu.get(T)||null,l,d,g,b,_)),!0;case"gotpointercapture":return T=_.pointerId,vu.set(T,xu(vu.get(T)||null,l,d,g,b,_)),!0}return!1}function Hk(l){var d=Ms(l.target);if(d!==null){var g=vi(d);if(g!==null){if(d=g.tag,d===13){if(d=sf(g),d!==null){l.blockedOn=d,Wk(l.priority,function(){Bk(g)});return}}else if(d===3&&g.stateNode.current.memoizedState.isDehydrated){l.blockedOn=g.tag===3?g.stateNode.containerInfo:null;return}}}l.blockedOn=null}function mf(l){if(l.blockedOn!==null)return!1;for(var d=l.targetContainers;0<d.length;){var g=Eg(l.domEventName,l.eventSystemFlags,d[0],l.nativeEvent);if(g===null){g=l.nativeEvent;var b=new g.constructor(g.type,g);gt=b,g.target.dispatchEvent(b),gt=null}else return d=Du(g),d!==null&&bg(d),l.blockedOn=g,!1;d.shift()}return!0}function Yk(l,d,g){mf(l)&&g.delete(d)}function k3(){kg=!1,Mo!==null&&mf(Mo)&&(Mo=null),Do!==null&&mf(Do)&&(Do=null),Oo!==null&&mf(Oo)&&(Oo=null),yu.forEach(Yk),vu.forEach(Yk)}function wu(l,d){l.blockedOn===d&&(l.blockedOn=null,kg||(kg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,k3)))}function bu(l){function d(_){return wu(_,l)}if(0<pf.length){wu(pf[0],l);for(var g=1;g<pf.length;g++){var b=pf[g];b.blockedOn===l&&(b.blockedOn=null)}}for(Mo!==null&&wu(Mo,l),Do!==null&&wu(Do,l),Oo!==null&&wu(Oo,l),yu.forEach(d),vu.forEach(d),g=0;g<Io.length;g++)b=Io[g],b.blockedOn===l&&(b.blockedOn=null);for(;0<Io.length&&(g=Io[0],g.blockedOn===null);)Hk(g),g.blockedOn===null&&Io.shift()}var Ra=N.ReactCurrentBatchConfig,gf=!0;function S3(l,d,g,b){var _=Nt,T=Ra.transition;Ra.transition=null;try{Nt=1,Sg(l,d,g,b)}finally{Nt=_,Ra.transition=T}}function E3(l,d,g,b){var _=Nt,T=Ra.transition;Ra.transition=null;try{Nt=4,Sg(l,d,g,b)}finally{Nt=_,Ra.transition=T}}function Sg(l,d,g,b){if(gf){var _=Eg(l,d,g,b);if(_===null)Bg(l,d,b,yf,g),Uk(l,b);else if(b3(_,l,d,g,b))b.stopPropagation();else if(Uk(l,b),d&4&&-1<w3.indexOf(l)){for(;_!==null;){var T=Du(_);if(T!==null&&$k(T),T=Eg(l,d,g,b),T===null&&Bg(l,d,b,yf,g),T===_)break;_=T}_!==null&&b.stopPropagation()}else Bg(l,d,b,null,g)}}var yf=null;function Eg(l,d,g,b){if(yf=null,l=jt(b),l=Ms(l),l!==null)if(d=vi(l),d===null)l=null;else if(g=d.tag,g===13){if(l=sf(d),l!==null)return l;l=null}else if(g===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;l=null}else d!==l&&(l=null);return yf=l,null}function qk(l){switch(l){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(fg()){case pu:return 1;case hf:return 4;case _a:case hg:return 16;case mu:return 536870912;default:return 16}default:return 16}}var jo=null,Cg=null,vf=null;function Gk(){if(vf)return vf;var l,d=Cg,g=d.length,b,_="value"in jo?jo.value:jo.textContent,T=_.length;for(l=0;l<g&&d[l]===_[l];l++);var z=g-l;for(b=1;b<=z&&d[g-b]===_[T-b];b++);return vf=_.slice(l,1<b?1-b:void 0)}function xf(l){var d=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&d===13&&(l=13)):l=d,l===10&&(l=13),32<=l||l===13?l:0}function wf(){return!0}function Zk(){return!1}function mr(l){function d(g,b,_,T,z){this._reactName=g,this._targetInst=_,this.type=b,this.nativeEvent=T,this.target=z,this.currentTarget=null;for(var X in l)l.hasOwnProperty(X)&&(g=l[X],this[X]=g?g(T):T[X]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?wf:Zk,this.isPropagationStopped=Zk,this}return L(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var g=this.nativeEvent;g&&(g.preventDefault?g.preventDefault():typeof g.returnValue!="unknown"&&(g.returnValue=!1),this.isDefaultPrevented=wf)},stopPropagation:function(){var g=this.nativeEvent;g&&(g.stopPropagation?g.stopPropagation():typeof g.cancelBubble!="unknown"&&(g.cancelBubble=!0),this.isPropagationStopped=wf)},persist:function(){},isPersistent:wf}),d}var Ma={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_g=mr(Ma),ku=L({},Ma,{view:0,detail:0}),C3=mr(ku),Ng,Tg,Su,bf=L({},ku,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pg,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==Su&&(Su&&l.type==="mousemove"?(Ng=l.screenX-Su.screenX,Tg=l.screenY-Su.screenY):Tg=Ng=0,Su=l),Ng)},movementY:function(l){return"movementY"in l?l.movementY:Tg}}),Kk=mr(bf),_3=L({},bf,{dataTransfer:0}),N3=mr(_3),T3=L({},ku,{relatedTarget:0}),Ag=mr(T3),A3=L({},Ma,{animationName:0,elapsedTime:0,pseudoElement:0}),P3=mr(A3),R3=L({},Ma,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),M3=mr(R3),D3=L({},Ma,{data:0}),Xk=mr(D3),O3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},I3={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},j3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function L3(l){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(l):(l=j3[l])?!!d[l]:!1}function Pg(){return L3}var F3=L({},ku,{key:function(l){if(l.key){var d=O3[l.key]||l.key;if(d!=="Unidentified")return d}return l.type==="keypress"?(l=xf(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?I3[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pg,charCode:function(l){return l.type==="keypress"?xf(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?xf(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),z3=mr(F3),$3=L({},bf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qk=mr($3),B3=L({},ku,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pg}),V3=mr(B3),W3=L({},Ma,{propertyName:0,elapsedTime:0,pseudoElement:0}),U3=mr(W3),H3=L({},bf,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),Y3=mr(H3),q3=[9,13,27,32],Rg=a&&"CompositionEvent"in window,Eu=null;a&&"documentMode"in document&&(Eu=document.documentMode);var G3=a&&"TextEvent"in window&&!Eu,Jk=a&&(!Rg||Eu&&8<Eu&&11>=Eu),eS=" ",tS=!1;function nS(l,d){switch(l){case"keyup":return q3.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rS(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Da=!1;function Z3(l,d){switch(l){case"compositionend":return rS(d);case"keypress":return d.which!==32?null:(tS=!0,eS);case"textInput":return l=d.data,l===eS&&tS?null:l;default:return null}}function K3(l,d){if(Da)return l==="compositionend"||!Rg&&nS(l,d)?(l=Gk(),vf=Cg=jo=null,Da=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return Jk&&d.locale!=="ko"?null:d.data;default:return null}}var X3={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function iS(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d==="input"?!!X3[l.type]:d==="textarea"}function oS(l,d,g,b){rn(b),d=_f(d,"onChange"),0<d.length&&(g=new _g("onChange","change",null,g,b),l.push({event:g,listeners:d}))}var Cu=null,_u=null;function Q3(l){SS(l,0)}function kf(l){var d=Fa(l);if(fe(d))return l}function J3(l,d){if(l==="change")return d}var sS=!1;if(a){var Mg;if(a){var Dg="oninput"in document;if(!Dg){var aS=document.createElement("div");aS.setAttribute("oninput","return;"),Dg=typeof aS.oninput=="function"}Mg=Dg}else Mg=!1;sS=Mg&&(!document.documentMode||9<document.documentMode)}function lS(){Cu&&(Cu.detachEvent("onpropertychange",uS),_u=Cu=null)}function uS(l){if(l.propertyName==="value"&&kf(_u)){var d=[];oS(d,_u,l,jt(l)),rf(Q3,d)}}function ez(l,d,g){l==="focusin"?(lS(),Cu=d,_u=g,Cu.attachEvent("onpropertychange",uS)):l==="focusout"&&lS()}function tz(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return kf(_u)}function nz(l,d){if(l==="click")return kf(d)}function rz(l,d){if(l==="input"||l==="change")return kf(d)}function iz(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var Zr=typeof Object.is=="function"?Object.is:iz;function Nu(l,d){if(Zr(l,d))return!0;if(typeof l!="object"||l===null||typeof d!="object"||d===null)return!1;var g=Object.keys(l),b=Object.keys(d);if(g.length!==b.length)return!1;for(b=0;b<g.length;b++){var _=g[b];if(!u.call(d,_)||!Zr(l[_],d[_]))return!1}return!0}function cS(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function dS(l,d){var g=cS(l);l=0;for(var b;g;){if(g.nodeType===3){if(b=l+g.textContent.length,l<=d&&b>=d)return{node:g,offset:d-l};l=b}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=cS(g)}}function fS(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?fS(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function hS(){for(var l=window,d=ve();d instanceof l.HTMLIFrameElement;){try{var g=typeof d.contentWindow.location.href=="string"}catch{g=!1}if(g)l=d.contentWindow;else break;d=ve(l.document)}return d}function Og(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d&&(d==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||d==="textarea"||l.contentEditable==="true")}function oz(l){var d=hS(),g=l.focusedElem,b=l.selectionRange;if(d!==g&&g&&g.ownerDocument&&fS(g.ownerDocument.documentElement,g)){if(b!==null&&Og(g)){if(d=b.start,l=b.end,l===void 0&&(l=d),"selectionStart"in g)g.selectionStart=d,g.selectionEnd=Math.min(l,g.value.length);else if(l=(d=g.ownerDocument||document)&&d.defaultView||window,l.getSelection){l=l.getSelection();var _=g.textContent.length,T=Math.min(b.start,_);b=b.end===void 0?T:Math.min(b.end,_),!l.extend&&T>b&&(_=b,b=T,T=_),_=dS(g,T);var z=dS(g,b);_&&z&&(l.rangeCount!==1||l.anchorNode!==_.node||l.anchorOffset!==_.offset||l.focusNode!==z.node||l.focusOffset!==z.offset)&&(d=d.createRange(),d.setStart(_.node,_.offset),l.removeAllRanges(),T>b?(l.addRange(d),l.extend(z.node,z.offset)):(d.setEnd(z.node,z.offset),l.addRange(d)))}}for(d=[],l=g;l=l.parentNode;)l.nodeType===1&&d.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<d.length;g++)l=d[g],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var sz=a&&"documentMode"in document&&11>=document.documentMode,Oa=null,Ig=null,Tu=null,jg=!1;function pS(l,d,g){var b=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;jg||Oa==null||Oa!==ve(b)||(b=Oa,"selectionStart"in b&&Og(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),Tu&&Nu(Tu,b)||(Tu=b,b=_f(Ig,"onSelect"),0<b.length&&(d=new _g("onSelect","select",null,d,g),l.push({event:d,listeners:b}),d.target=Oa)))}function Sf(l,d){var g={};return g[l.toLowerCase()]=d.toLowerCase(),g["Webkit"+l]="webkit"+d,g["Moz"+l]="moz"+d,g}var Ia={animationend:Sf("Animation","AnimationEnd"),animationiteration:Sf("Animation","AnimationIteration"),animationstart:Sf("Animation","AnimationStart"),transitionend:Sf("Transition","TransitionEnd")},Lg={},mS={};a&&(mS=document.createElement("div").style,"AnimationEvent"in window||(delete Ia.animationend.animation,delete Ia.animationiteration.animation,delete Ia.animationstart.animation),"TransitionEvent"in window||delete Ia.transitionend.transition);function Ef(l){if(Lg[l])return Lg[l];if(!Ia[l])return l;var d=Ia[l],g;for(g in d)if(d.hasOwnProperty(g)&&g in mS)return Lg[l]=d[g];return l}var gS=Ef("animationend"),yS=Ef("animationiteration"),vS=Ef("animationstart"),xS=Ef("transitionend"),wS=new Map,bS="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Lo(l,d){wS.set(l,d),o(d,[l])}for(var Fg=0;Fg<bS.length;Fg++){var zg=bS[Fg],az=zg.toLowerCase(),lz=zg[0].toUpperCase()+zg.slice(1);Lo(az,"on"+lz)}Lo(gS,"onAnimationEnd"),Lo(yS,"onAnimationIteration"),Lo(vS,"onAnimationStart"),Lo("dblclick","onDoubleClick"),Lo("focusin","onFocus"),Lo("focusout","onBlur"),Lo(xS,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Au="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),uz=new Set("cancel close invalid load scroll toggle".split(" ").concat(Au));function kS(l,d,g){var b=l.type||"unknown-event";l.currentTarget=g,of(b,d,void 0,l),l.currentTarget=null}function SS(l,d){d=(d&4)!==0;for(var g=0;g<l.length;g++){var b=l[g],_=b.event;b=b.listeners;e:{var T=void 0;if(d)for(var z=b.length-1;0<=z;z--){var X=b[z],te=X.instance,de=X.currentTarget;if(X=X.listener,te!==T&&_.isPropagationStopped())break e;kS(_,X,de),T=te}else for(z=0;z<b.length;z++){if(X=b[z],te=X.instance,de=X.currentTarget,X=X.listener,te!==T&&_.isPropagationStopped())break e;kS(_,X,de),T=te}}}if(Ca)throw l=hu,Ca=!1,hu=null,l}function Lt(l,d){var g=d[qg];g===void 0&&(g=d[qg]=new Set);var b=l+"__bubble";g.has(b)||(ES(d,l,2,!1),g.add(b))}function $g(l,d,g){var b=0;d&&(b|=4),ES(g,l,b,d)}var Cf="_reactListening"+Math.random().toString(36).slice(2);function Pu(l){if(!l[Cf]){l[Cf]=!0,r.forEach(function(g){g!=="selectionchange"&&(uz.has(g)||$g(g,!1,l),$g(g,!0,l))});var d=l.nodeType===9?l:l.ownerDocument;d===null||d[Cf]||(d[Cf]=!0,$g("selectionchange",!1,d))}}function ES(l,d,g,b){switch(qk(d)){case 1:var _=S3;break;case 4:_=E3;break;default:_=Sg}g=_.bind(null,d,g,l),_=void 0,!fu||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(_=!0),b?_!==void 0?l.addEventListener(d,g,{capture:!0,passive:_}):l.addEventListener(d,g,!0):_!==void 0?l.addEventListener(d,g,{passive:_}):l.addEventListener(d,g,!1)}function Bg(l,d,g,b,_){var T=b;if(!(d&1)&&!(d&2)&&b!==null)e:for(;;){if(b===null)return;var z=b.tag;if(z===3||z===4){var X=b.stateNode.containerInfo;if(X===_||X.nodeType===8&&X.parentNode===_)break;if(z===4)for(z=b.return;z!==null;){var te=z.tag;if((te===3||te===4)&&(te=z.stateNode.containerInfo,te===_||te.nodeType===8&&te.parentNode===_))return;z=z.return}for(;X!==null;){if(z=Ms(X),z===null)return;if(te=z.tag,te===5||te===6){b=T=z;continue e}X=X.parentNode}}b=b.return}rf(function(){var de=T,xe=jt(g),we=[];e:{var ye=wS.get(l);if(ye!==void 0){var De=_g,Le=l;switch(l){case"keypress":if(xf(g)===0)break e;case"keydown":case"keyup":De=z3;break;case"focusin":Le="focus",De=Ag;break;case"focusout":Le="blur",De=Ag;break;case"beforeblur":case"afterblur":De=Ag;break;case"click":if(g.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":De=Kk;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":De=N3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":De=V3;break;case gS:case yS:case vS:De=P3;break;case xS:De=U3;break;case"scroll":De=C3;break;case"wheel":De=Y3;break;case"copy":case"cut":case"paste":De=M3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":De=Qk}var ze=(d&4)!==0,on=!ze&&l==="scroll",se=ze?ye!==null?ye+"Capture":null:ye;ze=[];for(var ie=de,le;ie!==null;){le=ie;var _e=le.stateNode;if(le.tag===5&&_e!==null&&(le=_e,se!==null&&(_e=As(ie,se),_e!=null&&ze.push(Ru(ie,_e,le)))),on)break;ie=ie.return}0<ze.length&&(ye=new De(ye,Le,null,g,xe),we.push({event:ye,listeners:ze}))}}if(!(d&7)){e:{if(ye=l==="mouseover"||l==="pointerover",De=l==="mouseout"||l==="pointerout",ye&&g!==gt&&(Le=g.relatedTarget||g.fromElement)&&(Ms(Le)||Le[Gi]))break e;if((De||ye)&&(ye=xe.window===xe?xe:(ye=xe.ownerDocument)?ye.defaultView||ye.parentWindow:window,De?(Le=g.relatedTarget||g.toElement,De=de,Le=Le?Ms(Le):null,Le!==null&&(on=vi(Le),Le!==on||Le.tag!==5&&Le.tag!==6)&&(Le=null)):(De=null,Le=de),De!==Le)){if(ze=Kk,_e="onMouseLeave",se="onMouseEnter",ie="mouse",(l==="pointerout"||l==="pointerover")&&(ze=Qk,_e="onPointerLeave",se="onPointerEnter",ie="pointer"),on=De==null?ye:Fa(De),le=Le==null?ye:Fa(Le),ye=new ze(_e,ie+"leave",De,g,xe),ye.target=on,ye.relatedTarget=le,_e=null,Ms(xe)===de&&(ze=new ze(se,ie+"enter",Le,g,xe),ze.target=le,ze.relatedTarget=on,_e=ze),on=_e,De&&Le)t:{for(ze=De,se=Le,ie=0,le=ze;le;le=ja(le))ie++;for(le=0,_e=se;_e;_e=ja(_e))le++;for(;0<ie-le;)ze=ja(ze),ie--;for(;0<le-ie;)se=ja(se),le--;for(;ie--;){if(ze===se||se!==null&&ze===se.alternate)break t;ze=ja(ze),se=ja(se)}ze=null}else ze=null;De!==null&&CS(we,ye,De,ze,!1),Le!==null&&on!==null&&CS(we,on,Le,ze,!0)}}e:{if(ye=de?Fa(de):window,De=ye.nodeName&&ye.nodeName.toLowerCase(),De==="select"||De==="input"&&ye.type==="file")var Be=J3;else if(iS(ye))if(sS)Be=rz;else{Be=tz;var qe=ez}else(De=ye.nodeName)&&De.toLowerCase()==="input"&&(ye.type==="checkbox"||ye.type==="radio")&&(Be=nz);if(Be&&(Be=Be(l,de))){oS(we,Be,g,xe);break e}qe&&qe(l,ye,de),l==="focusout"&&(qe=ye._wrapperState)&&qe.controlled&&ye.type==="number"&&oe(ye,"number",ye.value)}switch(qe=de?Fa(de):window,l){case"focusin":(iS(qe)||qe.contentEditable==="true")&&(Oa=qe,Ig=de,Tu=null);break;case"focusout":Tu=Ig=Oa=null;break;case"mousedown":jg=!0;break;case"contextmenu":case"mouseup":case"dragend":jg=!1,pS(we,g,xe);break;case"selectionchange":if(sz)break;case"keydown":case"keyup":pS(we,g,xe)}var Ge;if(Rg)e:{switch(l){case"compositionstart":var rt="onCompositionStart";break e;case"compositionend":rt="onCompositionEnd";break e;case"compositionupdate":rt="onCompositionUpdate";break e}rt=void 0}else Da?nS(l,g)&&(rt="onCompositionEnd"):l==="keydown"&&g.keyCode===229&&(rt="onCompositionStart");rt&&(Jk&&g.locale!=="ko"&&(Da||rt!=="onCompositionStart"?rt==="onCompositionEnd"&&Da&&(Ge=Gk()):(jo=xe,Cg="value"in jo?jo.value:jo.textContent,Da=!0)),qe=_f(de,rt),0<qe.length&&(rt=new Xk(rt,l,null,g,xe),we.push({event:rt,listeners:qe}),Ge?rt.data=Ge:(Ge=rS(g),Ge!==null&&(rt.data=Ge)))),(Ge=G3?Z3(l,g):K3(l,g))&&(de=_f(de,"onBeforeInput"),0<de.length&&(xe=new Xk("onBeforeInput","beforeinput",null,g,xe),we.push({event:xe,listeners:de}),xe.data=Ge))}SS(we,d)})}function Ru(l,d,g){return{instance:l,listener:d,currentTarget:g}}function _f(l,d){for(var g=d+"Capture",b=[];l!==null;){var _=l,T=_.stateNode;_.tag===5&&T!==null&&(_=T,T=As(l,g),T!=null&&b.unshift(Ru(l,T,_)),T=As(l,d),T!=null&&b.push(Ru(l,T,_))),l=l.return}return b}function ja(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function CS(l,d,g,b,_){for(var T=d._reactName,z=[];g!==null&&g!==b;){var X=g,te=X.alternate,de=X.stateNode;if(te!==null&&te===b)break;X.tag===5&&de!==null&&(X=de,_?(te=As(g,T),te!=null&&z.unshift(Ru(g,te,X))):_||(te=As(g,T),te!=null&&z.push(Ru(g,te,X)))),g=g.return}z.length!==0&&l.push({event:d,listeners:z})}var cz=/\r\n?/g,dz=/\u0000|\uFFFD/g;function _S(l){return(typeof l=="string"?l:""+l).replace(cz,`
38
+ `).replace(dz,"")}function Nf(l,d,g){if(d=_S(d),_S(l)!==d&&g)throw Error(n(425))}function Tf(){}var Vg=null,Wg=null;function Ug(l,d){return l==="textarea"||l==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var Hg=typeof setTimeout=="function"?setTimeout:void 0,fz=typeof clearTimeout=="function"?clearTimeout:void 0,NS=typeof Promise=="function"?Promise:void 0,hz=typeof queueMicrotask=="function"?queueMicrotask:typeof NS<"u"?function(l){return NS.resolve(null).then(l).catch(pz)}:Hg;function pz(l){setTimeout(function(){throw l})}function Yg(l,d){var g=d,b=0;do{var _=g.nextSibling;if(l.removeChild(g),_&&_.nodeType===8)if(g=_.data,g==="/$"){if(b===0){l.removeChild(_),bu(d);return}b--}else g!=="$"&&g!=="$?"&&g!=="$!"||b++;g=_}while(g);bu(d)}function Fo(l){for(;l!=null;l=l.nextSibling){var d=l.nodeType;if(d===1||d===3)break;if(d===8){if(d=l.data,d==="$"||d==="$!"||d==="$?")break;if(d==="/$")return null}}return l}function TS(l){l=l.previousSibling;for(var d=0;l;){if(l.nodeType===8){var g=l.data;if(g==="$"||g==="$!"||g==="$?"){if(d===0)return l;d--}else g==="/$"&&d++}l=l.previousSibling}return null}var La=Math.random().toString(36).slice(2),xi="__reactFiber$"+La,Mu="__reactProps$"+La,Gi="__reactContainer$"+La,qg="__reactEvents$"+La,mz="__reactListeners$"+La,gz="__reactHandles$"+La;function Ms(l){var d=l[xi];if(d)return d;for(var g=l.parentNode;g;){if(d=g[Gi]||g[xi]){if(g=d.alternate,d.child!==null||g!==null&&g.child!==null)for(l=TS(l);l!==null;){if(g=l[xi])return g;l=TS(l)}return d}l=g,g=l.parentNode}return null}function Du(l){return l=l[xi]||l[Gi],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Fa(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Af(l){return l[Mu]||null}var Gg=[],za=-1;function zo(l){return{current:l}}function Ft(l){0>za||(l.current=Gg[za],Gg[za]=null,za--)}function Mt(l,d){za++,Gg[za]=l.current,l.current=d}var $o={},jn=zo($o),rr=zo(!1),Ds=$o;function $a(l,d){var g=l.type.contextTypes;if(!g)return $o;var b=l.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===d)return b.__reactInternalMemoizedMaskedChildContext;var _={},T;for(T in g)_[T]=d[T];return b&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=d,l.__reactInternalMemoizedMaskedChildContext=_),_}function ir(l){return l=l.childContextTypes,l!=null}function Pf(){Ft(rr),Ft(jn)}function AS(l,d,g){if(jn.current!==$o)throw Error(n(168));Mt(jn,d),Mt(rr,g)}function PS(l,d,g){var b=l.stateNode;if(d=d.childContextTypes,typeof b.getChildContext!="function")return g;b=b.getChildContext();for(var _ in b)if(!(_ in d))throw Error(n(108,ee(l)||"Unknown",_));return L({},g,b)}function Rf(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||$o,Ds=jn.current,Mt(jn,l),Mt(rr,rr.current),!0}function RS(l,d,g){var b=l.stateNode;if(!b)throw Error(n(169));g?(l=PS(l,d,Ds),b.__reactInternalMemoizedMergedChildContext=l,Ft(rr),Ft(jn),Mt(jn,l)):Ft(rr),Mt(rr,g)}var Zi=null,Mf=!1,Zg=!1;function MS(l){Zi===null?Zi=[l]:Zi.push(l)}function yz(l){Mf=!0,MS(l)}function Bo(){if(!Zg&&Zi!==null){Zg=!0;var l=0,d=Nt;try{var g=Zi;for(Nt=1;l<g.length;l++){var b=g[l];do b=b(!0);while(b!==null)}Zi=null,Mf=!1}catch(_){throw Zi!==null&&(Zi=Zi.slice(l+1)),cf(pu,Bo),_}finally{Nt=d,Zg=!1}}return null}var Ba=[],Va=0,Df=null,Of=0,Dr=[],Or=0,Os=null,Ki=1,Xi="";function Is(l,d){Ba[Va++]=Of,Ba[Va++]=Df,Df=l,Of=d}function DS(l,d,g){Dr[Or++]=Ki,Dr[Or++]=Xi,Dr[Or++]=Os,Os=l;var b=Ki;l=Xi;var _=32-pr(b)-1;b&=~(1<<_),g+=1;var T=32-pr(d)+_;if(30<T){var z=_-_%5;T=(b&(1<<z)-1).toString(32),b>>=z,_-=z,Ki=1<<32-pr(d)+_|g<<_|b,Xi=T+l}else Ki=1<<T|g<<_|b,Xi=l}function Kg(l){l.return!==null&&(Is(l,1),DS(l,1,0))}function Xg(l){for(;l===Df;)Df=Ba[--Va],Ba[Va]=null,Of=Ba[--Va],Ba[Va]=null;for(;l===Os;)Os=Dr[--Or],Dr[Or]=null,Xi=Dr[--Or],Dr[Or]=null,Ki=Dr[--Or],Dr[Or]=null}var gr=null,yr=null,Ut=!1,Kr=null;function OS(l,d){var g=Fr(5,null,null,0);g.elementType="DELETED",g.stateNode=d,g.return=l,d=l.deletions,d===null?(l.deletions=[g],l.flags|=16):d.push(g)}function IS(l,d){switch(l.tag){case 5:var g=l.type;return d=d.nodeType!==1||g.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(l.stateNode=d,gr=l,yr=Fo(d.firstChild),!0):!1;case 6:return d=l.pendingProps===""||d.nodeType!==3?null:d,d!==null?(l.stateNode=d,gr=l,yr=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(g=Os!==null?{id:Ki,overflow:Xi}:null,l.memoizedState={dehydrated:d,treeContext:g,retryLane:1073741824},g=Fr(18,null,null,0),g.stateNode=d,g.return=l,l.child=g,gr=l,yr=null,!0):!1;default:return!1}}function Qg(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Jg(l){if(Ut){var d=yr;if(d){var g=d;if(!IS(l,d)){if(Qg(l))throw Error(n(418));d=Fo(g.nextSibling);var b=gr;d&&IS(l,d)?OS(b,g):(l.flags=l.flags&-4097|2,Ut=!1,gr=l)}}else{if(Qg(l))throw Error(n(418));l.flags=l.flags&-4097|2,Ut=!1,gr=l}}}function jS(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;gr=l}function If(l){if(l!==gr)return!1;if(!Ut)return jS(l),Ut=!0,!1;var d;if((d=l.tag!==3)&&!(d=l.tag!==5)&&(d=l.type,d=d!=="head"&&d!=="body"&&!Ug(l.type,l.memoizedProps)),d&&(d=yr)){if(Qg(l))throw LS(),Error(n(418));for(;d;)OS(l,d),d=Fo(d.nextSibling)}if(jS(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,d=0;l;){if(l.nodeType===8){var g=l.data;if(g==="/$"){if(d===0){yr=Fo(l.nextSibling);break e}d--}else g!=="$"&&g!=="$!"&&g!=="$?"||d++}l=l.nextSibling}yr=null}}else yr=gr?Fo(l.stateNode.nextSibling):null;return!0}function LS(){for(var l=yr;l;)l=Fo(l.nextSibling)}function Wa(){yr=gr=null,Ut=!1}function ey(l){Kr===null?Kr=[l]:Kr.push(l)}var vz=N.ReactCurrentBatchConfig;function Ou(l,d,g){if(l=g.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(n(309));var b=g.stateNode}if(!b)throw Error(n(147,l));var _=b,T=""+l;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===T?d.ref:(d=function(z){var X=_.refs;z===null?delete X[T]:X[T]=z},d._stringRef=T,d)}if(typeof l!="string")throw Error(n(284));if(!g._owner)throw Error(n(290,l))}return l}function jf(l,d){throw l=Object.prototype.toString.call(d),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":l))}function FS(l){var d=l._init;return d(l._payload)}function zS(l){function d(se,ie){if(l){var le=se.deletions;le===null?(se.deletions=[ie],se.flags|=16):le.push(ie)}}function g(se,ie){if(!l)return null;for(;ie!==null;)d(se,ie),ie=ie.sibling;return null}function b(se,ie){for(se=new Map;ie!==null;)ie.key!==null?se.set(ie.key,ie):se.set(ie.index,ie),ie=ie.sibling;return se}function _(se,ie){return se=Zo(se,ie),se.index=0,se.sibling=null,se}function T(se,ie,le){return se.index=le,l?(le=se.alternate,le!==null?(le=le.index,le<ie?(se.flags|=2,ie):le):(se.flags|=2,ie)):(se.flags|=1048576,ie)}function z(se){return l&&se.alternate===null&&(se.flags|=2),se}function X(se,ie,le,_e){return ie===null||ie.tag!==6?(ie=Hy(le,se.mode,_e),ie.return=se,ie):(ie=_(ie,le),ie.return=se,ie)}function te(se,ie,le,_e){var Be=le.type;return Be===O?xe(se,ie,le.props.children,_e,le.key):ie!==null&&(ie.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===q&&FS(Be)===ie.type)?(_e=_(ie,le.props),_e.ref=Ou(se,ie,le),_e.return=se,_e):(_e=sh(le.type,le.key,le.props,null,se.mode,_e),_e.ref=Ou(se,ie,le),_e.return=se,_e)}function de(se,ie,le,_e){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==le.containerInfo||ie.stateNode.implementation!==le.implementation?(ie=Yy(le,se.mode,_e),ie.return=se,ie):(ie=_(ie,le.children||[]),ie.return=se,ie)}function xe(se,ie,le,_e,Be){return ie===null||ie.tag!==7?(ie=Ws(le,se.mode,_e,Be),ie.return=se,ie):(ie=_(ie,le),ie.return=se,ie)}function we(se,ie,le){if(typeof ie=="string"&&ie!==""||typeof ie=="number")return ie=Hy(""+ie,se.mode,le),ie.return=se,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case P:return le=sh(ie.type,ie.key,ie.props,null,se.mode,le),le.ref=Ou(se,null,ie),le.return=se,le;case A:return ie=Yy(ie,se.mode,le),ie.return=se,ie;case q:var _e=ie._init;return we(se,_e(ie._payload),le)}if(ae(ie)||W(ie))return ie=Ws(ie,se.mode,le,null),ie.return=se,ie;jf(se,ie)}return null}function ye(se,ie,le,_e){var Be=ie!==null?ie.key:null;if(typeof le=="string"&&le!==""||typeof le=="number")return Be!==null?null:X(se,ie,""+le,_e);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case P:return le.key===Be?te(se,ie,le,_e):null;case A:return le.key===Be?de(se,ie,le,_e):null;case q:return Be=le._init,ye(se,ie,Be(le._payload),_e)}if(ae(le)||W(le))return Be!==null?null:xe(se,ie,le,_e,null);jf(se,le)}return null}function De(se,ie,le,_e,Be){if(typeof _e=="string"&&_e!==""||typeof _e=="number")return se=se.get(le)||null,X(ie,se,""+_e,Be);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case P:return se=se.get(_e.key===null?le:_e.key)||null,te(ie,se,_e,Be);case A:return se=se.get(_e.key===null?le:_e.key)||null,de(ie,se,_e,Be);case q:var qe=_e._init;return De(se,ie,le,qe(_e._payload),Be)}if(ae(_e)||W(_e))return se=se.get(le)||null,xe(ie,se,_e,Be,null);jf(ie,_e)}return null}function Le(se,ie,le,_e){for(var Be=null,qe=null,Ge=ie,rt=ie=0,Nn=null;Ge!==null&&rt<le.length;rt++){Ge.index>rt?(Nn=Ge,Ge=null):Nn=Ge.sibling;var kt=ye(se,Ge,le[rt],_e);if(kt===null){Ge===null&&(Ge=Nn);break}l&&Ge&&kt.alternate===null&&d(se,Ge),ie=T(kt,ie,rt),qe===null?Be=kt:qe.sibling=kt,qe=kt,Ge=Nn}if(rt===le.length)return g(se,Ge),Ut&&Is(se,rt),Be;if(Ge===null){for(;rt<le.length;rt++)Ge=we(se,le[rt],_e),Ge!==null&&(ie=T(Ge,ie,rt),qe===null?Be=Ge:qe.sibling=Ge,qe=Ge);return Ut&&Is(se,rt),Be}for(Ge=b(se,Ge);rt<le.length;rt++)Nn=De(Ge,se,rt,le[rt],_e),Nn!==null&&(l&&Nn.alternate!==null&&Ge.delete(Nn.key===null?rt:Nn.key),ie=T(Nn,ie,rt),qe===null?Be=Nn:qe.sibling=Nn,qe=Nn);return l&&Ge.forEach(function(Ko){return d(se,Ko)}),Ut&&Is(se,rt),Be}function ze(se,ie,le,_e){var Be=W(le);if(typeof Be!="function")throw Error(n(150));if(le=Be.call(le),le==null)throw Error(n(151));for(var qe=Be=null,Ge=ie,rt=ie=0,Nn=null,kt=le.next();Ge!==null&&!kt.done;rt++,kt=le.next()){Ge.index>rt?(Nn=Ge,Ge=null):Nn=Ge.sibling;var Ko=ye(se,Ge,kt.value,_e);if(Ko===null){Ge===null&&(Ge=Nn);break}l&&Ge&&Ko.alternate===null&&d(se,Ge),ie=T(Ko,ie,rt),qe===null?Be=Ko:qe.sibling=Ko,qe=Ko,Ge=Nn}if(kt.done)return g(se,Ge),Ut&&Is(se,rt),Be;if(Ge===null){for(;!kt.done;rt++,kt=le.next())kt=we(se,kt.value,_e),kt!==null&&(ie=T(kt,ie,rt),qe===null?Be=kt:qe.sibling=kt,qe=kt);return Ut&&Is(se,rt),Be}for(Ge=b(se,Ge);!kt.done;rt++,kt=le.next())kt=De(Ge,se,rt,kt.value,_e),kt!==null&&(l&&kt.alternate!==null&&Ge.delete(kt.key===null?rt:kt.key),ie=T(kt,ie,rt),qe===null?Be=kt:qe.sibling=kt,qe=kt);return l&&Ge.forEach(function(Kz){return d(se,Kz)}),Ut&&Is(se,rt),Be}function on(se,ie,le,_e){if(typeof le=="object"&&le!==null&&le.type===O&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case P:e:{for(var Be=le.key,qe=ie;qe!==null;){if(qe.key===Be){if(Be=le.type,Be===O){if(qe.tag===7){g(se,qe.sibling),ie=_(qe,le.props.children),ie.return=se,se=ie;break e}}else if(qe.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===q&&FS(Be)===qe.type){g(se,qe.sibling),ie=_(qe,le.props),ie.ref=Ou(se,qe,le),ie.return=se,se=ie;break e}g(se,qe);break}else d(se,qe);qe=qe.sibling}le.type===O?(ie=Ws(le.props.children,se.mode,_e,le.key),ie.return=se,se=ie):(_e=sh(le.type,le.key,le.props,null,se.mode,_e),_e.ref=Ou(se,ie,le),_e.return=se,se=_e)}return z(se);case A:e:{for(qe=le.key;ie!==null;){if(ie.key===qe)if(ie.tag===4&&ie.stateNode.containerInfo===le.containerInfo&&ie.stateNode.implementation===le.implementation){g(se,ie.sibling),ie=_(ie,le.children||[]),ie.return=se,se=ie;break e}else{g(se,ie);break}else d(se,ie);ie=ie.sibling}ie=Yy(le,se.mode,_e),ie.return=se,se=ie}return z(se);case q:return qe=le._init,on(se,ie,qe(le._payload),_e)}if(ae(le))return Le(se,ie,le,_e);if(W(le))return ze(se,ie,le,_e);jf(se,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,ie!==null&&ie.tag===6?(g(se,ie.sibling),ie=_(ie,le),ie.return=se,se=ie):(g(se,ie),ie=Hy(le,se.mode,_e),ie.return=se,se=ie),z(se)):g(se,ie)}return on}var Ua=zS(!0),$S=zS(!1),Lf=zo(null),Ff=null,Ha=null,ty=null;function ny(){ty=Ha=Ff=null}function ry(l){var d=Lf.current;Ft(Lf),l._currentValue=d}function iy(l,d,g){for(;l!==null;){var b=l.alternate;if((l.childLanes&d)!==d?(l.childLanes|=d,b!==null&&(b.childLanes|=d)):b!==null&&(b.childLanes&d)!==d&&(b.childLanes|=d),l===g)break;l=l.return}}function Ya(l,d){Ff=l,ty=Ha=null,l=l.dependencies,l!==null&&l.firstContext!==null&&(l.lanes&d&&(or=!0),l.firstContext=null)}function Ir(l){var d=l._currentValue;if(ty!==l)if(l={context:l,memoizedValue:d,next:null},Ha===null){if(Ff===null)throw Error(n(308));Ha=l,Ff.dependencies={lanes:0,firstContext:l}}else Ha=Ha.next=l;return d}var js=null;function oy(l){js===null?js=[l]:js.push(l)}function BS(l,d,g,b){var _=d.interleaved;return _===null?(g.next=g,oy(d)):(g.next=_.next,_.next=g),d.interleaved=g,Qi(l,b)}function Qi(l,d){l.lanes|=d;var g=l.alternate;for(g!==null&&(g.lanes|=d),g=l,l=l.return;l!==null;)l.childLanes|=d,g=l.alternate,g!==null&&(g.childLanes|=d),g=l,l=l.return;return g.tag===3?g.stateNode:null}var Vo=!1;function sy(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function VS(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Ji(l,d){return{eventTime:l,lane:d,tag:0,payload:null,callback:null,next:null}}function Wo(l,d,g){var b=l.updateQueue;if(b===null)return null;if(b=b.shared,wt&2){var _=b.pending;return _===null?d.next=d:(d.next=_.next,_.next=d),b.pending=d,Qi(l,g)}return _=b.interleaved,_===null?(d.next=d,oy(b)):(d.next=_.next,_.next=d),b.interleaved=d,Qi(l,g)}function zf(l,d,g){if(d=d.updateQueue,d!==null&&(d=d.shared,(g&4194240)!==0)){var b=d.lanes;b&=l.pendingLanes,g|=b,d.lanes=g,wg(l,g)}}function WS(l,d){var g=l.updateQueue,b=l.alternate;if(b!==null&&(b=b.updateQueue,g===b)){var _=null,T=null;if(g=g.firstBaseUpdate,g!==null){do{var z={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};T===null?_=T=z:T=T.next=z,g=g.next}while(g!==null);T===null?_=T=d:T=T.next=d}else _=T=d;g={baseState:b.baseState,firstBaseUpdate:_,lastBaseUpdate:T,shared:b.shared,effects:b.effects},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=d:l.next=d,g.lastBaseUpdate=d}function $f(l,d,g,b){var _=l.updateQueue;Vo=!1;var T=_.firstBaseUpdate,z=_.lastBaseUpdate,X=_.shared.pending;if(X!==null){_.shared.pending=null;var te=X,de=te.next;te.next=null,z===null?T=de:z.next=de,z=te;var xe=l.alternate;xe!==null&&(xe=xe.updateQueue,X=xe.lastBaseUpdate,X!==z&&(X===null?xe.firstBaseUpdate=de:X.next=de,xe.lastBaseUpdate=te))}if(T!==null){var we=_.baseState;z=0,xe=de=te=null,X=T;do{var ye=X.lane,De=X.eventTime;if((b&ye)===ye){xe!==null&&(xe=xe.next={eventTime:De,lane:0,tag:X.tag,payload:X.payload,callback:X.callback,next:null});e:{var Le=l,ze=X;switch(ye=d,De=g,ze.tag){case 1:if(Le=ze.payload,typeof Le=="function"){we=Le.call(De,we,ye);break e}we=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=ze.payload,ye=typeof Le=="function"?Le.call(De,we,ye):Le,ye==null)break e;we=L({},we,ye);break e;case 2:Vo=!0}}X.callback!==null&&X.lane!==0&&(l.flags|=64,ye=_.effects,ye===null?_.effects=[X]:ye.push(X))}else De={eventTime:De,lane:ye,tag:X.tag,payload:X.payload,callback:X.callback,next:null},xe===null?(de=xe=De,te=we):xe=xe.next=De,z|=ye;if(X=X.next,X===null){if(X=_.shared.pending,X===null)break;ye=X,X=ye.next,ye.next=null,_.lastBaseUpdate=ye,_.shared.pending=null}}while(!0);if(xe===null&&(te=we),_.baseState=te,_.firstBaseUpdate=de,_.lastBaseUpdate=xe,d=_.shared.interleaved,d!==null){_=d;do z|=_.lane,_=_.next;while(_!==d)}else T===null&&(_.shared.lanes=0);zs|=z,l.lanes=z,l.memoizedState=we}}function US(l,d,g){if(l=d.effects,d.effects=null,l!==null)for(d=0;d<l.length;d++){var b=l[d],_=b.callback;if(_!==null){if(b.callback=null,b=g,typeof _!="function")throw Error(n(191,_));_.call(b)}}}var Iu={},wi=zo(Iu),ju=zo(Iu),Lu=zo(Iu);function Ls(l){if(l===Iu)throw Error(n(174));return l}function ay(l,d){switch(Mt(Lu,d),Mt(ju,l),Mt(wi,Iu),l=d.nodeType,l){case 9:case 11:d=(d=d.documentElement)?d.namespaceURI:pe(null,"");break;default:l=l===8?d.parentNode:d,d=l.namespaceURI||null,l=l.tagName,d=pe(d,l)}Ft(wi),Mt(wi,d)}function qa(){Ft(wi),Ft(ju),Ft(Lu)}function HS(l){Ls(Lu.current);var d=Ls(wi.current),g=pe(d,l.type);d!==g&&(Mt(ju,l),Mt(wi,g))}function ly(l){ju.current===l&&(Ft(wi),Ft(ju))}var Zt=zo(0);function Bf(l){for(var d=l;d!==null;){if(d.tag===13){var g=d.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||g.data==="$?"||g.data==="$!"))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if(d.flags&128)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var uy=[];function cy(){for(var l=0;l<uy.length;l++)uy[l]._workInProgressVersionPrimary=null;uy.length=0}var Vf=N.ReactCurrentDispatcher,dy=N.ReactCurrentBatchConfig,Fs=0,Kt=null,xn=null,Cn=null,Wf=!1,Fu=!1,zu=0,xz=0;function Ln(){throw Error(n(321))}function fy(l,d){if(d===null)return!1;for(var g=0;g<d.length&&g<l.length;g++)if(!Zr(l[g],d[g]))return!1;return!0}function hy(l,d,g,b,_,T){if(Fs=T,Kt=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,Vf.current=l===null||l.memoizedState===null?Sz:Ez,l=g(b,_),Fu){T=0;do{if(Fu=!1,zu=0,25<=T)throw Error(n(301));T+=1,Cn=xn=null,d.updateQueue=null,Vf.current=Cz,l=g(b,_)}while(Fu)}if(Vf.current=Yf,d=xn!==null&&xn.next!==null,Fs=0,Cn=xn=Kt=null,Wf=!1,d)throw Error(n(300));return l}function py(){var l=zu!==0;return zu=0,l}function bi(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Cn===null?Kt.memoizedState=Cn=l:Cn=Cn.next=l,Cn}function jr(){if(xn===null){var l=Kt.alternate;l=l!==null?l.memoizedState:null}else l=xn.next;var d=Cn===null?Kt.memoizedState:Cn.next;if(d!==null)Cn=d,xn=l;else{if(l===null)throw Error(n(310));xn=l,l={memoizedState:xn.memoizedState,baseState:xn.baseState,baseQueue:xn.baseQueue,queue:xn.queue,next:null},Cn===null?Kt.memoizedState=Cn=l:Cn=Cn.next=l}return Cn}function $u(l,d){return typeof d=="function"?d(l):d}function my(l){var d=jr(),g=d.queue;if(g===null)throw Error(n(311));g.lastRenderedReducer=l;var b=xn,_=b.baseQueue,T=g.pending;if(T!==null){if(_!==null){var z=_.next;_.next=T.next,T.next=z}b.baseQueue=_=T,g.pending=null}if(_!==null){T=_.next,b=b.baseState;var X=z=null,te=null,de=T;do{var xe=de.lane;if((Fs&xe)===xe)te!==null&&(te=te.next={lane:0,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),b=de.hasEagerState?de.eagerState:l(b,de.action);else{var we={lane:xe,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null};te===null?(X=te=we,z=b):te=te.next=we,Kt.lanes|=xe,zs|=xe}de=de.next}while(de!==null&&de!==T);te===null?z=b:te.next=X,Zr(b,d.memoizedState)||(or=!0),d.memoizedState=b,d.baseState=z,d.baseQueue=te,g.lastRenderedState=b}if(l=g.interleaved,l!==null){_=l;do T=_.lane,Kt.lanes|=T,zs|=T,_=_.next;while(_!==l)}else _===null&&(g.lanes=0);return[d.memoizedState,g.dispatch]}function gy(l){var d=jr(),g=d.queue;if(g===null)throw Error(n(311));g.lastRenderedReducer=l;var b=g.dispatch,_=g.pending,T=d.memoizedState;if(_!==null){g.pending=null;var z=_=_.next;do T=l(T,z.action),z=z.next;while(z!==_);Zr(T,d.memoizedState)||(or=!0),d.memoizedState=T,d.baseQueue===null&&(d.baseState=T),g.lastRenderedState=T}return[T,b]}function YS(){}function qS(l,d){var g=Kt,b=jr(),_=d(),T=!Zr(b.memoizedState,_);if(T&&(b.memoizedState=_,or=!0),b=b.queue,yy(KS.bind(null,g,b,l),[l]),b.getSnapshot!==d||T||Cn!==null&&Cn.memoizedState.tag&1){if(g.flags|=2048,Bu(9,ZS.bind(null,g,b,_,d),void 0,null),_n===null)throw Error(n(349));Fs&30||GS(g,d,_)}return _}function GS(l,d,g){l.flags|=16384,l={getSnapshot:d,value:g},d=Kt.updateQueue,d===null?(d={lastEffect:null,stores:null},Kt.updateQueue=d,d.stores=[l]):(g=d.stores,g===null?d.stores=[l]:g.push(l))}function ZS(l,d,g,b){d.value=g,d.getSnapshot=b,XS(d)&&QS(l)}function KS(l,d,g){return g(function(){XS(d)&&QS(l)})}function XS(l){var d=l.getSnapshot;l=l.value;try{var g=d();return!Zr(l,g)}catch{return!0}}function QS(l){var d=Qi(l,1);d!==null&&ei(d,l,1,-1)}function JS(l){var d=bi();return typeof l=="function"&&(l=l()),d.memoizedState=d.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$u,lastRenderedState:l},d.queue=l,l=l.dispatch=kz.bind(null,Kt,l),[d.memoizedState,l]}function Bu(l,d,g,b){return l={tag:l,create:d,destroy:g,deps:b,next:null},d=Kt.updateQueue,d===null?(d={lastEffect:null,stores:null},Kt.updateQueue=d,d.lastEffect=l.next=l):(g=d.lastEffect,g===null?d.lastEffect=l.next=l:(b=g.next,g.next=l,l.next=b,d.lastEffect=l)),l}function eE(){return jr().memoizedState}function Uf(l,d,g,b){var _=bi();Kt.flags|=l,_.memoizedState=Bu(1|d,g,void 0,b===void 0?null:b)}function Hf(l,d,g,b){var _=jr();b=b===void 0?null:b;var T=void 0;if(xn!==null){var z=xn.memoizedState;if(T=z.destroy,b!==null&&fy(b,z.deps)){_.memoizedState=Bu(d,g,T,b);return}}Kt.flags|=l,_.memoizedState=Bu(1|d,g,T,b)}function tE(l,d){return Uf(8390656,8,l,d)}function yy(l,d){return Hf(2048,8,l,d)}function nE(l,d){return Hf(4,2,l,d)}function rE(l,d){return Hf(4,4,l,d)}function iE(l,d){if(typeof d=="function")return l=l(),d(l),function(){d(null)};if(d!=null)return l=l(),d.current=l,function(){d.current=null}}function oE(l,d,g){return g=g!=null?g.concat([l]):null,Hf(4,4,iE.bind(null,d,l),g)}function vy(){}function sE(l,d){var g=jr();d=d===void 0?null:d;var b=g.memoizedState;return b!==null&&d!==null&&fy(d,b[1])?b[0]:(g.memoizedState=[l,d],l)}function aE(l,d){var g=jr();d=d===void 0?null:d;var b=g.memoizedState;return b!==null&&d!==null&&fy(d,b[1])?b[0]:(l=l(),g.memoizedState=[l,d],l)}function lE(l,d,g){return Fs&21?(Zr(g,d)||(g=Fk(),Kt.lanes|=g,zs|=g,l.baseState=!0),d):(l.baseState&&(l.baseState=!1,or=!0),l.memoizedState=g)}function wz(l,d){var g=Nt;Nt=g!==0&&4>g?g:4,l(!0);var b=dy.transition;dy.transition={};try{l(!1),d()}finally{Nt=g,dy.transition=b}}function uE(){return jr().memoizedState}function bz(l,d,g){var b=qo(l);if(g={lane:b,action:g,hasEagerState:!1,eagerState:null,next:null},cE(l))dE(d,g);else if(g=BS(l,d,g,b),g!==null){var _=Zn();ei(g,l,b,_),fE(g,d,b)}}function kz(l,d,g){var b=qo(l),_={lane:b,action:g,hasEagerState:!1,eagerState:null,next:null};if(cE(l))dE(d,_);else{var T=l.alternate;if(l.lanes===0&&(T===null||T.lanes===0)&&(T=d.lastRenderedReducer,T!==null))try{var z=d.lastRenderedState,X=T(z,g);if(_.hasEagerState=!0,_.eagerState=X,Zr(X,z)){var te=d.interleaved;te===null?(_.next=_,oy(d)):(_.next=te.next,te.next=_),d.interleaved=_;return}}catch{}finally{}g=BS(l,d,_,b),g!==null&&(_=Zn(),ei(g,l,b,_),fE(g,d,b))}}function cE(l){var d=l.alternate;return l===Kt||d!==null&&d===Kt}function dE(l,d){Fu=Wf=!0;var g=l.pending;g===null?d.next=d:(d.next=g.next,g.next=d),l.pending=d}function fE(l,d,g){if(g&4194240){var b=d.lanes;b&=l.pendingLanes,g|=b,d.lanes=g,wg(l,g)}}var Yf={readContext:Ir,useCallback:Ln,useContext:Ln,useEffect:Ln,useImperativeHandle:Ln,useInsertionEffect:Ln,useLayoutEffect:Ln,useMemo:Ln,useReducer:Ln,useRef:Ln,useState:Ln,useDebugValue:Ln,useDeferredValue:Ln,useTransition:Ln,useMutableSource:Ln,useSyncExternalStore:Ln,useId:Ln,unstable_isNewReconciler:!1},Sz={readContext:Ir,useCallback:function(l,d){return bi().memoizedState=[l,d===void 0?null:d],l},useContext:Ir,useEffect:tE,useImperativeHandle:function(l,d,g){return g=g!=null?g.concat([l]):null,Uf(4194308,4,iE.bind(null,d,l),g)},useLayoutEffect:function(l,d){return Uf(4194308,4,l,d)},useInsertionEffect:function(l,d){return Uf(4,2,l,d)},useMemo:function(l,d){var g=bi();return d=d===void 0?null:d,l=l(),g.memoizedState=[l,d],l},useReducer:function(l,d,g){var b=bi();return d=g!==void 0?g(d):d,b.memoizedState=b.baseState=d,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:d},b.queue=l,l=l.dispatch=bz.bind(null,Kt,l),[b.memoizedState,l]},useRef:function(l){var d=bi();return l={current:l},d.memoizedState=l},useState:JS,useDebugValue:vy,useDeferredValue:function(l){return bi().memoizedState=l},useTransition:function(){var l=JS(!1),d=l[0];return l=wz.bind(null,l[1]),bi().memoizedState=l,[d,l]},useMutableSource:function(){},useSyncExternalStore:function(l,d,g){var b=Kt,_=bi();if(Ut){if(g===void 0)throw Error(n(407));g=g()}else{if(g=d(),_n===null)throw Error(n(349));Fs&30||GS(b,d,g)}_.memoizedState=g;var T={value:g,getSnapshot:d};return _.queue=T,tE(KS.bind(null,b,T,l),[l]),b.flags|=2048,Bu(9,ZS.bind(null,b,T,g,d),void 0,null),g},useId:function(){var l=bi(),d=_n.identifierPrefix;if(Ut){var g=Xi,b=Ki;g=(b&~(1<<32-pr(b)-1)).toString(32)+g,d=":"+d+"R"+g,g=zu++,0<g&&(d+="H"+g.toString(32)),d+=":"}else g=xz++,d=":"+d+"r"+g.toString(32)+":";return l.memoizedState=d},unstable_isNewReconciler:!1},Ez={readContext:Ir,useCallback:sE,useContext:Ir,useEffect:yy,useImperativeHandle:oE,useInsertionEffect:nE,useLayoutEffect:rE,useMemo:aE,useReducer:my,useRef:eE,useState:function(){return my($u)},useDebugValue:vy,useDeferredValue:function(l){var d=jr();return lE(d,xn.memoizedState,l)},useTransition:function(){var l=my($u)[0],d=jr().memoizedState;return[l,d]},useMutableSource:YS,useSyncExternalStore:qS,useId:uE,unstable_isNewReconciler:!1},Cz={readContext:Ir,useCallback:sE,useContext:Ir,useEffect:yy,useImperativeHandle:oE,useInsertionEffect:nE,useLayoutEffect:rE,useMemo:aE,useReducer:gy,useRef:eE,useState:function(){return gy($u)},useDebugValue:vy,useDeferredValue:function(l){var d=jr();return xn===null?d.memoizedState=l:lE(d,xn.memoizedState,l)},useTransition:function(){var l=gy($u)[0],d=jr().memoizedState;return[l,d]},useMutableSource:YS,useSyncExternalStore:qS,useId:uE,unstable_isNewReconciler:!1};function Xr(l,d){if(l&&l.defaultProps){d=L({},d),l=l.defaultProps;for(var g in l)d[g]===void 0&&(d[g]=l[g]);return d}return d}function xy(l,d,g,b){d=l.memoizedState,g=g(b,d),g=g==null?d:L({},d,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}var qf={isMounted:function(l){return(l=l._reactInternals)?vi(l)===l:!1},enqueueSetState:function(l,d,g){l=l._reactInternals;var b=Zn(),_=qo(l),T=Ji(b,_);T.payload=d,g!=null&&(T.callback=g),d=Wo(l,T,_),d!==null&&(ei(d,l,_,b),zf(d,l,_))},enqueueReplaceState:function(l,d,g){l=l._reactInternals;var b=Zn(),_=qo(l),T=Ji(b,_);T.tag=1,T.payload=d,g!=null&&(T.callback=g),d=Wo(l,T,_),d!==null&&(ei(d,l,_,b),zf(d,l,_))},enqueueForceUpdate:function(l,d){l=l._reactInternals;var g=Zn(),b=qo(l),_=Ji(g,b);_.tag=2,d!=null&&(_.callback=d),d=Wo(l,_,b),d!==null&&(ei(d,l,b,g),zf(d,l,b))}};function hE(l,d,g,b,_,T,z){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(b,T,z):d.prototype&&d.prototype.isPureReactComponent?!Nu(g,b)||!Nu(_,T):!0}function pE(l,d,g){var b=!1,_=$o,T=d.contextType;return typeof T=="object"&&T!==null?T=Ir(T):(_=ir(d)?Ds:jn.current,b=d.contextTypes,T=(b=b!=null)?$a(l,_):$o),d=new d(g,T),l.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=qf,l.stateNode=d,d._reactInternals=l,b&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=_,l.__reactInternalMemoizedMaskedChildContext=T),d}function mE(l,d,g,b){l=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(g,b),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(g,b),d.state!==l&&qf.enqueueReplaceState(d,d.state,null)}function wy(l,d,g,b){var _=l.stateNode;_.props=g,_.state=l.memoizedState,_.refs={},sy(l);var T=d.contextType;typeof T=="object"&&T!==null?_.context=Ir(T):(T=ir(d)?Ds:jn.current,_.context=$a(l,T)),_.state=l.memoizedState,T=d.getDerivedStateFromProps,typeof T=="function"&&(xy(l,d,T,g),_.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(d=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),d!==_.state&&qf.enqueueReplaceState(_,_.state,null),$f(l,g,_,b),_.state=l.memoizedState),typeof _.componentDidMount=="function"&&(l.flags|=4194308)}function Ga(l,d){try{var g="",b=d;do g+=K(b),b=b.return;while(b);var _=g}catch(T){_=`
39
+ Error generating stack: `+T.message+`
40
+ `+T.stack}return{value:l,source:d,stack:_,digest:null}}function by(l,d,g){return{value:l,source:null,stack:g??null,digest:d??null}}function ky(l,d){try{console.error(d.value)}catch(g){setTimeout(function(){throw g})}}var _z=typeof WeakMap=="function"?WeakMap:Map;function gE(l,d,g){g=Ji(-1,g),g.tag=3,g.payload={element:null};var b=d.value;return g.callback=function(){eh||(eh=!0,Ly=b),ky(l,d)},g}function yE(l,d,g){g=Ji(-1,g),g.tag=3;var b=l.type.getDerivedStateFromError;if(typeof b=="function"){var _=d.value;g.payload=function(){return b(_)},g.callback=function(){ky(l,d)}}var T=l.stateNode;return T!==null&&typeof T.componentDidCatch=="function"&&(g.callback=function(){ky(l,d),typeof b!="function"&&(Ho===null?Ho=new Set([this]):Ho.add(this));var z=d.stack;this.componentDidCatch(d.value,{componentStack:z!==null?z:""})}),g}function vE(l,d,g){var b=l.pingCache;if(b===null){b=l.pingCache=new _z;var _=new Set;b.set(d,_)}else _=b.get(d),_===void 0&&(_=new Set,b.set(d,_));_.has(g)||(_.add(g),l=$z.bind(null,l,d,g),d.then(l,l))}function xE(l){do{var d;if((d=l.tag===13)&&(d=l.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return l;l=l.return}while(l!==null);return null}function wE(l,d,g,b,_){return l.mode&1?(l.flags|=65536,l.lanes=_,l):(l===d?l.flags|=65536:(l.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(d=Ji(-1,1),d.tag=2,Wo(g,d,1))),g.lanes|=1),l)}var Nz=N.ReactCurrentOwner,or=!1;function Gn(l,d,g,b){d.child=l===null?$S(d,null,g,b):Ua(d,l.child,g,b)}function bE(l,d,g,b,_){g=g.render;var T=d.ref;return Ya(d,_),b=hy(l,d,g,b,T,_),g=py(),l!==null&&!or?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~_,eo(l,d,_)):(Ut&&g&&Kg(d),d.flags|=1,Gn(l,d,b,_),d.child)}function kE(l,d,g,b,_){if(l===null){var T=g.type;return typeof T=="function"&&!Uy(T)&&T.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(d.tag=15,d.type=T,SE(l,d,T,b,_)):(l=sh(g.type,null,b,d,d.mode,_),l.ref=d.ref,l.return=d,d.child=l)}if(T=l.child,!(l.lanes&_)){var z=T.memoizedProps;if(g=g.compare,g=g!==null?g:Nu,g(z,b)&&l.ref===d.ref)return eo(l,d,_)}return d.flags|=1,l=Zo(T,b),l.ref=d.ref,l.return=d,d.child=l}function SE(l,d,g,b,_){if(l!==null){var T=l.memoizedProps;if(Nu(T,b)&&l.ref===d.ref)if(or=!1,d.pendingProps=b=T,(l.lanes&_)!==0)l.flags&131072&&(or=!0);else return d.lanes=l.lanes,eo(l,d,_)}return Sy(l,d,g,b,_)}function EE(l,d,g){var b=d.pendingProps,_=b.children,T=l!==null?l.memoizedState:null;if(b.mode==="hidden")if(!(d.mode&1))d.memoizedState={baseLanes:0,cachePool:null,transitions:null},Mt(Ka,vr),vr|=g;else{if(!(g&1073741824))return l=T!==null?T.baseLanes|g:g,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:l,cachePool:null,transitions:null},d.updateQueue=null,Mt(Ka,vr),vr|=l,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},b=T!==null?T.baseLanes:g,Mt(Ka,vr),vr|=b}else T!==null?(b=T.baseLanes|g,d.memoizedState=null):b=g,Mt(Ka,vr),vr|=b;return Gn(l,d,_,g),d.child}function CE(l,d){var g=d.ref;(l===null&&g!==null||l!==null&&l.ref!==g)&&(d.flags|=512,d.flags|=2097152)}function Sy(l,d,g,b,_){var T=ir(g)?Ds:jn.current;return T=$a(d,T),Ya(d,_),g=hy(l,d,g,b,T,_),b=py(),l!==null&&!or?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~_,eo(l,d,_)):(Ut&&b&&Kg(d),d.flags|=1,Gn(l,d,g,_),d.child)}function _E(l,d,g,b,_){if(ir(g)){var T=!0;Rf(d)}else T=!1;if(Ya(d,_),d.stateNode===null)Zf(l,d),pE(d,g,b),wy(d,g,b,_),b=!0;else if(l===null){var z=d.stateNode,X=d.memoizedProps;z.props=X;var te=z.context,de=g.contextType;typeof de=="object"&&de!==null?de=Ir(de):(de=ir(g)?Ds:jn.current,de=$a(d,de));var xe=g.getDerivedStateFromProps,we=typeof xe=="function"||typeof z.getSnapshotBeforeUpdate=="function";we||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(X!==b||te!==de)&&mE(d,z,b,de),Vo=!1;var ye=d.memoizedState;z.state=ye,$f(d,b,z,_),te=d.memoizedState,X!==b||ye!==te||rr.current||Vo?(typeof xe=="function"&&(xy(d,g,xe,b),te=d.memoizedState),(X=Vo||hE(d,g,X,b,ye,te,de))?(we||typeof z.UNSAFE_componentWillMount!="function"&&typeof z.componentWillMount!="function"||(typeof z.componentWillMount=="function"&&z.componentWillMount(),typeof z.UNSAFE_componentWillMount=="function"&&z.UNSAFE_componentWillMount()),typeof z.componentDidMount=="function"&&(d.flags|=4194308)):(typeof z.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=b,d.memoizedState=te),z.props=b,z.state=te,z.context=de,b=X):(typeof z.componentDidMount=="function"&&(d.flags|=4194308),b=!1)}else{z=d.stateNode,VS(l,d),X=d.memoizedProps,de=d.type===d.elementType?X:Xr(d.type,X),z.props=de,we=d.pendingProps,ye=z.context,te=g.contextType,typeof te=="object"&&te!==null?te=Ir(te):(te=ir(g)?Ds:jn.current,te=$a(d,te));var De=g.getDerivedStateFromProps;(xe=typeof De=="function"||typeof z.getSnapshotBeforeUpdate=="function")||typeof z.UNSAFE_componentWillReceiveProps!="function"&&typeof z.componentWillReceiveProps!="function"||(X!==we||ye!==te)&&mE(d,z,b,te),Vo=!1,ye=d.memoizedState,z.state=ye,$f(d,b,z,_);var Le=d.memoizedState;X!==we||ye!==Le||rr.current||Vo?(typeof De=="function"&&(xy(d,g,De,b),Le=d.memoizedState),(de=Vo||hE(d,g,de,b,ye,Le,te)||!1)?(xe||typeof z.UNSAFE_componentWillUpdate!="function"&&typeof z.componentWillUpdate!="function"||(typeof z.componentWillUpdate=="function"&&z.componentWillUpdate(b,Le,te),typeof z.UNSAFE_componentWillUpdate=="function"&&z.UNSAFE_componentWillUpdate(b,Le,te)),typeof z.componentDidUpdate=="function"&&(d.flags|=4),typeof z.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof z.componentDidUpdate!="function"||X===l.memoizedProps&&ye===l.memoizedState||(d.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||X===l.memoizedProps&&ye===l.memoizedState||(d.flags|=1024),d.memoizedProps=b,d.memoizedState=Le),z.props=b,z.state=Le,z.context=te,b=de):(typeof z.componentDidUpdate!="function"||X===l.memoizedProps&&ye===l.memoizedState||(d.flags|=4),typeof z.getSnapshotBeforeUpdate!="function"||X===l.memoizedProps&&ye===l.memoizedState||(d.flags|=1024),b=!1)}return Ey(l,d,g,b,T,_)}function Ey(l,d,g,b,_,T){CE(l,d);var z=(d.flags&128)!==0;if(!b&&!z)return _&&RS(d,g,!1),eo(l,d,T);b=d.stateNode,Nz.current=d;var X=z&&typeof g.getDerivedStateFromError!="function"?null:b.render();return d.flags|=1,l!==null&&z?(d.child=Ua(d,l.child,null,T),d.child=Ua(d,null,X,T)):Gn(l,d,X,T),d.memoizedState=b.state,_&&RS(d,g,!0),d.child}function NE(l){var d=l.stateNode;d.pendingContext?AS(l,d.pendingContext,d.pendingContext!==d.context):d.context&&AS(l,d.context,!1),ay(l,d.containerInfo)}function TE(l,d,g,b,_){return Wa(),ey(_),d.flags|=256,Gn(l,d,g,b),d.child}var Cy={dehydrated:null,treeContext:null,retryLane:0};function _y(l){return{baseLanes:l,cachePool:null,transitions:null}}function AE(l,d,g){var b=d.pendingProps,_=Zt.current,T=!1,z=(d.flags&128)!==0,X;if((X=z)||(X=l!==null&&l.memoizedState===null?!1:(_&2)!==0),X?(T=!0,d.flags&=-129):(l===null||l.memoizedState!==null)&&(_|=1),Mt(Zt,_&1),l===null)return Jg(d),l=d.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?(d.mode&1?l.data==="$!"?d.lanes=8:d.lanes=1073741824:d.lanes=1,null):(z=b.children,l=b.fallback,T?(b=d.mode,T=d.child,z={mode:"hidden",children:z},!(b&1)&&T!==null?(T.childLanes=0,T.pendingProps=z):T=ah(z,b,0,null),l=Ws(l,b,g,null),T.return=d,l.return=d,T.sibling=l,d.child=T,d.child.memoizedState=_y(g),d.memoizedState=Cy,l):Ny(d,z));if(_=l.memoizedState,_!==null&&(X=_.dehydrated,X!==null))return Tz(l,d,z,b,X,_,g);if(T){T=b.fallback,z=d.mode,_=l.child,X=_.sibling;var te={mode:"hidden",children:b.children};return!(z&1)&&d.child!==_?(b=d.child,b.childLanes=0,b.pendingProps=te,d.deletions=null):(b=Zo(_,te),b.subtreeFlags=_.subtreeFlags&14680064),X!==null?T=Zo(X,T):(T=Ws(T,z,g,null),T.flags|=2),T.return=d,b.return=d,b.sibling=T,d.child=b,b=T,T=d.child,z=l.child.memoizedState,z=z===null?_y(g):{baseLanes:z.baseLanes|g,cachePool:null,transitions:z.transitions},T.memoizedState=z,T.childLanes=l.childLanes&~g,d.memoizedState=Cy,b}return T=l.child,l=T.sibling,b=Zo(T,{mode:"visible",children:b.children}),!(d.mode&1)&&(b.lanes=g),b.return=d,b.sibling=null,l!==null&&(g=d.deletions,g===null?(d.deletions=[l],d.flags|=16):g.push(l)),d.child=b,d.memoizedState=null,b}function Ny(l,d){return d=ah({mode:"visible",children:d},l.mode,0,null),d.return=l,l.child=d}function Gf(l,d,g,b){return b!==null&&ey(b),Ua(d,l.child,null,g),l=Ny(d,d.pendingProps.children),l.flags|=2,d.memoizedState=null,l}function Tz(l,d,g,b,_,T,z){if(g)return d.flags&256?(d.flags&=-257,b=by(Error(n(422))),Gf(l,d,z,b)):d.memoizedState!==null?(d.child=l.child,d.flags|=128,null):(T=b.fallback,_=d.mode,b=ah({mode:"visible",children:b.children},_,0,null),T=Ws(T,_,z,null),T.flags|=2,b.return=d,T.return=d,b.sibling=T,d.child=b,d.mode&1&&Ua(d,l.child,null,z),d.child.memoizedState=_y(z),d.memoizedState=Cy,T);if(!(d.mode&1))return Gf(l,d,z,null);if(_.data==="$!"){if(b=_.nextSibling&&_.nextSibling.dataset,b)var X=b.dgst;return b=X,T=Error(n(419)),b=by(T,b,void 0),Gf(l,d,z,b)}if(X=(z&l.childLanes)!==0,or||X){if(b=_n,b!==null){switch(z&-z){case 4:_=2;break;case 16:_=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:_=32;break;case 536870912:_=268435456;break;default:_=0}_=_&(b.suspendedLanes|z)?0:_,_!==0&&_!==T.retryLane&&(T.retryLane=_,Qi(l,_),ei(b,l,_,-1))}return Wy(),b=by(Error(n(421))),Gf(l,d,z,b)}return _.data==="$?"?(d.flags|=128,d.child=l.child,d=Bz.bind(null,l),_._reactRetry=d,null):(l=T.treeContext,yr=Fo(_.nextSibling),gr=d,Ut=!0,Kr=null,l!==null&&(Dr[Or++]=Ki,Dr[Or++]=Xi,Dr[Or++]=Os,Ki=l.id,Xi=l.overflow,Os=d),d=Ny(d,b.children),d.flags|=4096,d)}function PE(l,d,g){l.lanes|=d;var b=l.alternate;b!==null&&(b.lanes|=d),iy(l.return,d,g)}function Ty(l,d,g,b,_){var T=l.memoizedState;T===null?l.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:b,tail:g,tailMode:_}:(T.isBackwards=d,T.rendering=null,T.renderingStartTime=0,T.last=b,T.tail=g,T.tailMode=_)}function RE(l,d,g){var b=d.pendingProps,_=b.revealOrder,T=b.tail;if(Gn(l,d,b.children,g),b=Zt.current,b&2)b=b&1|2,d.flags|=128;else{if(l!==null&&l.flags&128)e:for(l=d.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&PE(l,g,d);else if(l.tag===19)PE(l,g,d);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===d)break e;for(;l.sibling===null;){if(l.return===null||l.return===d)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}b&=1}if(Mt(Zt,b),!(d.mode&1))d.memoizedState=null;else switch(_){case"forwards":for(g=d.child,_=null;g!==null;)l=g.alternate,l!==null&&Bf(l)===null&&(_=g),g=g.sibling;g=_,g===null?(_=d.child,d.child=null):(_=g.sibling,g.sibling=null),Ty(d,!1,_,g,T);break;case"backwards":for(g=null,_=d.child,d.child=null;_!==null;){if(l=_.alternate,l!==null&&Bf(l)===null){d.child=_;break}l=_.sibling,_.sibling=g,g=_,_=l}Ty(d,!0,g,null,T);break;case"together":Ty(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function Zf(l,d){!(d.mode&1)&&l!==null&&(l.alternate=null,d.alternate=null,d.flags|=2)}function eo(l,d,g){if(l!==null&&(d.dependencies=l.dependencies),zs|=d.lanes,!(g&d.childLanes))return null;if(l!==null&&d.child!==l.child)throw Error(n(153));if(d.child!==null){for(l=d.child,g=Zo(l,l.pendingProps),d.child=g,g.return=d;l.sibling!==null;)l=l.sibling,g=g.sibling=Zo(l,l.pendingProps),g.return=d;g.sibling=null}return d.child}function Az(l,d,g){switch(d.tag){case 3:NE(d),Wa();break;case 5:HS(d);break;case 1:ir(d.type)&&Rf(d);break;case 4:ay(d,d.stateNode.containerInfo);break;case 10:var b=d.type._context,_=d.memoizedProps.value;Mt(Lf,b._currentValue),b._currentValue=_;break;case 13:if(b=d.memoizedState,b!==null)return b.dehydrated!==null?(Mt(Zt,Zt.current&1),d.flags|=128,null):g&d.child.childLanes?AE(l,d,g):(Mt(Zt,Zt.current&1),l=eo(l,d,g),l!==null?l.sibling:null);Mt(Zt,Zt.current&1);break;case 19:if(b=(g&d.childLanes)!==0,l.flags&128){if(b)return RE(l,d,g);d.flags|=128}if(_=d.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),Mt(Zt,Zt.current),b)break;return null;case 22:case 23:return d.lanes=0,EE(l,d,g)}return eo(l,d,g)}var ME,Ay,DE,OE;ME=function(l,d){for(var g=d.child;g!==null;){if(g.tag===5||g.tag===6)l.appendChild(g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===d)break;for(;g.sibling===null;){if(g.return===null||g.return===d)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},Ay=function(){},DE=function(l,d,g,b){var _=l.memoizedProps;if(_!==b){l=d.stateNode,Ls(wi.current);var T=null;switch(g){case"input":_=Me(l,_),b=Me(l,b),T=[];break;case"select":_=L({},_,{value:void 0}),b=L({},b,{value:void 0}),T=[];break;case"textarea":_=ke(l,_),b=ke(l,b),T=[];break;default:typeof _.onClick!="function"&&typeof b.onClick=="function"&&(l.onclick=Tf)}yt(g,b);var z;g=null;for(de in _)if(!b.hasOwnProperty(de)&&_.hasOwnProperty(de)&&_[de]!=null)if(de==="style"){var X=_[de];for(z in X)X.hasOwnProperty(z)&&(g||(g={}),g[z]="")}else de!=="dangerouslySetInnerHTML"&&de!=="children"&&de!=="suppressContentEditableWarning"&&de!=="suppressHydrationWarning"&&de!=="autoFocus"&&(i.hasOwnProperty(de)?T||(T=[]):(T=T||[]).push(de,null));for(de in b){var te=b[de];if(X=_!=null?_[de]:void 0,b.hasOwnProperty(de)&&te!==X&&(te!=null||X!=null))if(de==="style")if(X){for(z in X)!X.hasOwnProperty(z)||te&&te.hasOwnProperty(z)||(g||(g={}),g[z]="");for(z in te)te.hasOwnProperty(z)&&X[z]!==te[z]&&(g||(g={}),g[z]=te[z])}else g||(T||(T=[]),T.push(de,g)),g=te;else de==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,X=X?X.__html:void 0,te!=null&&X!==te&&(T=T||[]).push(de,te)):de==="children"?typeof te!="string"&&typeof te!="number"||(T=T||[]).push(de,""+te):de!=="suppressContentEditableWarning"&&de!=="suppressHydrationWarning"&&(i.hasOwnProperty(de)?(te!=null&&de==="onScroll"&&Lt("scroll",l),T||X===te||(T=[])):(T=T||[]).push(de,te))}g&&(T=T||[]).push("style",g);var de=T;(d.updateQueue=de)&&(d.flags|=4)}},OE=function(l,d,g,b){g!==b&&(d.flags|=4)};function Vu(l,d){if(!Ut)switch(l.tailMode){case"hidden":d=l.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?l.tail=null:g.sibling=null;break;case"collapsed":g=l.tail;for(var b=null;g!==null;)g.alternate!==null&&(b=g),g=g.sibling;b===null?d||l.tail===null?l.tail=null:l.tail.sibling=null:b.sibling=null}}function Fn(l){var d=l.alternate!==null&&l.alternate.child===l.child,g=0,b=0;if(d)for(var _=l.child;_!==null;)g|=_.lanes|_.childLanes,b|=_.subtreeFlags&14680064,b|=_.flags&14680064,_.return=l,_=_.sibling;else for(_=l.child;_!==null;)g|=_.lanes|_.childLanes,b|=_.subtreeFlags,b|=_.flags,_.return=l,_=_.sibling;return l.subtreeFlags|=b,l.childLanes=g,d}function Pz(l,d,g){var b=d.pendingProps;switch(Xg(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fn(d),null;case 1:return ir(d.type)&&Pf(),Fn(d),null;case 3:return b=d.stateNode,qa(),Ft(rr),Ft(jn),cy(),b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),(l===null||l.child===null)&&(If(d)?d.flags|=4:l===null||l.memoizedState.isDehydrated&&!(d.flags&256)||(d.flags|=1024,Kr!==null&&($y(Kr),Kr=null))),Ay(l,d),Fn(d),null;case 5:ly(d);var _=Ls(Lu.current);if(g=d.type,l!==null&&d.stateNode!=null)DE(l,d,g,b,_),l.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!b){if(d.stateNode===null)throw Error(n(166));return Fn(d),null}if(l=Ls(wi.current),If(d)){b=d.stateNode,g=d.type;var T=d.memoizedProps;switch(b[xi]=d,b[Mu]=T,l=(d.mode&1)!==0,g){case"dialog":Lt("cancel",b),Lt("close",b);break;case"iframe":case"object":case"embed":Lt("load",b);break;case"video":case"audio":for(_=0;_<Au.length;_++)Lt(Au[_],b);break;case"source":Lt("error",b);break;case"img":case"image":case"link":Lt("error",b),Lt("load",b);break;case"details":Lt("toggle",b);break;case"input":$e(b,T),Lt("invalid",b);break;case"select":b._wrapperState={wasMultiple:!!T.multiple},Lt("invalid",b);break;case"textarea":ge(b,T),Lt("invalid",b)}yt(g,T),_=null;for(var z in T)if(T.hasOwnProperty(z)){var X=T[z];z==="children"?typeof X=="string"?b.textContent!==X&&(T.suppressHydrationWarning!==!0&&Nf(b.textContent,X,l),_=["children",X]):typeof X=="number"&&b.textContent!==""+X&&(T.suppressHydrationWarning!==!0&&Nf(b.textContent,X,l),_=["children",""+X]):i.hasOwnProperty(z)&&X!=null&&z==="onScroll"&&Lt("scroll",b)}switch(g){case"input":be(b),Q(b,T,!0);break;case"textarea":be(b),Fe(b);break;case"select":case"option":break;default:typeof T.onClick=="function"&&(b.onclick=Tf)}b=_,d.updateQueue=b,b!==null&&(d.flags|=4)}else{z=_.nodeType===9?_:_.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=ce(g)),l==="http://www.w3.org/1999/xhtml"?g==="script"?(l=z.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof b.is=="string"?l=z.createElement(g,{is:b.is}):(l=z.createElement(g),g==="select"&&(z=l,b.multiple?z.multiple=!0:b.size&&(z.size=b.size))):l=z.createElementNS(l,g),l[xi]=d,l[Mu]=b,ME(l,d,!1,!1),d.stateNode=l;e:{switch(z=yn(g,b),g){case"dialog":Lt("cancel",l),Lt("close",l),_=b;break;case"iframe":case"object":case"embed":Lt("load",l),_=b;break;case"video":case"audio":for(_=0;_<Au.length;_++)Lt(Au[_],l);_=b;break;case"source":Lt("error",l),_=b;break;case"img":case"image":case"link":Lt("error",l),Lt("load",l),_=b;break;case"details":Lt("toggle",l),_=b;break;case"input":$e(l,b),_=Me(l,b),Lt("invalid",l);break;case"option":_=b;break;case"select":l._wrapperState={wasMultiple:!!b.multiple},_=L({},b,{value:void 0}),Lt("invalid",l);break;case"textarea":ge(l,b),_=ke(l,b),Lt("invalid",l);break;default:_=b}yt(g,_),X=_;for(T in X)if(X.hasOwnProperty(T)){var te=X[T];T==="style"?at(l,te):T==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&Ke(l,te)):T==="children"?typeof te=="string"?(g!=="textarea"||te!=="")&&tt(l,te):typeof te=="number"&&tt(l,""+te):T!=="suppressContentEditableWarning"&&T!=="suppressHydrationWarning"&&T!=="autoFocus"&&(i.hasOwnProperty(T)?te!=null&&T==="onScroll"&&Lt("scroll",l):te!=null&&C(l,T,te,z))}switch(g){case"input":be(l),Q(l,b,!1);break;case"textarea":be(l),Fe(l);break;case"option":b.value!=null&&l.setAttribute("value",""+re(b.value));break;case"select":l.multiple=!!b.multiple,T=b.value,T!=null?Ce(l,!!b.multiple,T,!1):b.defaultValue!=null&&Ce(l,!!b.multiple,b.defaultValue,!0);break;default:typeof _.onClick=="function"&&(l.onclick=Tf)}switch(g){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}}b&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return Fn(d),null;case 6:if(l&&d.stateNode!=null)OE(l,d,l.memoizedProps,b);else{if(typeof b!="string"&&d.stateNode===null)throw Error(n(166));if(g=Ls(Lu.current),Ls(wi.current),If(d)){if(b=d.stateNode,g=d.memoizedProps,b[xi]=d,(T=b.nodeValue!==g)&&(l=gr,l!==null))switch(l.tag){case 3:Nf(b.nodeValue,g,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Nf(b.nodeValue,g,(l.mode&1)!==0)}T&&(d.flags|=4)}else b=(g.nodeType===9?g:g.ownerDocument).createTextNode(b),b[xi]=d,d.stateNode=b}return Fn(d),null;case 13:if(Ft(Zt),b=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(Ut&&yr!==null&&d.mode&1&&!(d.flags&128))LS(),Wa(),d.flags|=98560,T=!1;else if(T=If(d),b!==null&&b.dehydrated!==null){if(l===null){if(!T)throw Error(n(318));if(T=d.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(n(317));T[xi]=d}else Wa(),!(d.flags&128)&&(d.memoizedState=null),d.flags|=4;Fn(d),T=!1}else Kr!==null&&($y(Kr),Kr=null),T=!0;if(!T)return d.flags&65536?d:null}return d.flags&128?(d.lanes=g,d):(b=b!==null,b!==(l!==null&&l.memoizedState!==null)&&b&&(d.child.flags|=8192,d.mode&1&&(l===null||Zt.current&1?wn===0&&(wn=3):Wy())),d.updateQueue!==null&&(d.flags|=4),Fn(d),null);case 4:return qa(),Ay(l,d),l===null&&Pu(d.stateNode.containerInfo),Fn(d),null;case 10:return ry(d.type._context),Fn(d),null;case 17:return ir(d.type)&&Pf(),Fn(d),null;case 19:if(Ft(Zt),T=d.memoizedState,T===null)return Fn(d),null;if(b=(d.flags&128)!==0,z=T.rendering,z===null)if(b)Vu(T,!1);else{if(wn!==0||l!==null&&l.flags&128)for(l=d.child;l!==null;){if(z=Bf(l),z!==null){for(d.flags|=128,Vu(T,!1),b=z.updateQueue,b!==null&&(d.updateQueue=b,d.flags|=4),d.subtreeFlags=0,b=g,g=d.child;g!==null;)T=g,l=b,T.flags&=14680066,z=T.alternate,z===null?(T.childLanes=0,T.lanes=l,T.child=null,T.subtreeFlags=0,T.memoizedProps=null,T.memoizedState=null,T.updateQueue=null,T.dependencies=null,T.stateNode=null):(T.childLanes=z.childLanes,T.lanes=z.lanes,T.child=z.child,T.subtreeFlags=0,T.deletions=null,T.memoizedProps=z.memoizedProps,T.memoizedState=z.memoizedState,T.updateQueue=z.updateQueue,T.type=z.type,l=z.dependencies,T.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),g=g.sibling;return Mt(Zt,Zt.current&1|2),d.child}l=l.sibling}T.tail!==null&&Gt()>Xa&&(d.flags|=128,b=!0,Vu(T,!1),d.lanes=4194304)}else{if(!b)if(l=Bf(z),l!==null){if(d.flags|=128,b=!0,g=l.updateQueue,g!==null&&(d.updateQueue=g,d.flags|=4),Vu(T,!0),T.tail===null&&T.tailMode==="hidden"&&!z.alternate&&!Ut)return Fn(d),null}else 2*Gt()-T.renderingStartTime>Xa&&g!==1073741824&&(d.flags|=128,b=!0,Vu(T,!1),d.lanes=4194304);T.isBackwards?(z.sibling=d.child,d.child=z):(g=T.last,g!==null?g.sibling=z:d.child=z,T.last=z)}return T.tail!==null?(d=T.tail,T.rendering=d,T.tail=d.sibling,T.renderingStartTime=Gt(),d.sibling=null,g=Zt.current,Mt(Zt,b?g&1|2:g&1),d):(Fn(d),null);case 22:case 23:return Vy(),b=d.memoizedState!==null,l!==null&&l.memoizedState!==null!==b&&(d.flags|=8192),b&&d.mode&1?vr&1073741824&&(Fn(d),d.subtreeFlags&6&&(d.flags|=8192)):Fn(d),null;case 24:return null;case 25:return null}throw Error(n(156,d.tag))}function Rz(l,d){switch(Xg(d),d.tag){case 1:return ir(d.type)&&Pf(),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return qa(),Ft(rr),Ft(jn),cy(),l=d.flags,l&65536&&!(l&128)?(d.flags=l&-65537|128,d):null;case 5:return ly(d),null;case 13:if(Ft(Zt),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(n(340));Wa()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return Ft(Zt),null;case 4:return qa(),null;case 10:return ry(d.type._context),null;case 22:case 23:return Vy(),null;case 24:return null;default:return null}}var Kf=!1,zn=!1,Mz=typeof WeakSet=="function"?WeakSet:Set,je=null;function Za(l,d){var g=l.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(b){en(l,d,b)}else g.current=null}function Py(l,d,g){try{g()}catch(b){en(l,d,b)}}var IE=!1;function Dz(l,d){if(Vg=gf,l=hS(),Og(l)){if("selectionStart"in l)var g={start:l.selectionStart,end:l.selectionEnd};else e:{g=(g=l.ownerDocument)&&g.defaultView||window;var b=g.getSelection&&g.getSelection();if(b&&b.rangeCount!==0){g=b.anchorNode;var _=b.anchorOffset,T=b.focusNode;b=b.focusOffset;try{g.nodeType,T.nodeType}catch{g=null;break e}var z=0,X=-1,te=-1,de=0,xe=0,we=l,ye=null;t:for(;;){for(var De;we!==g||_!==0&&we.nodeType!==3||(X=z+_),we!==T||b!==0&&we.nodeType!==3||(te=z+b),we.nodeType===3&&(z+=we.nodeValue.length),(De=we.firstChild)!==null;)ye=we,we=De;for(;;){if(we===l)break t;if(ye===g&&++de===_&&(X=z),ye===T&&++xe===b&&(te=z),(De=we.nextSibling)!==null)break;we=ye,ye=we.parentNode}we=De}g=X===-1||te===-1?null:{start:X,end:te}}else g=null}g=g||{start:0,end:0}}else g=null;for(Wg={focusedElem:l,selectionRange:g},gf=!1,je=d;je!==null;)if(d=je,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,je=l;else for(;je!==null;){d=je;try{var Le=d.alternate;if(d.flags&1024)switch(d.tag){case 0:case 11:case 15:break;case 1:if(Le!==null){var ze=Le.memoizedProps,on=Le.memoizedState,se=d.stateNode,ie=se.getSnapshotBeforeUpdate(d.elementType===d.type?ze:Xr(d.type,ze),on);se.__reactInternalSnapshotBeforeUpdate=ie}break;case 3:var le=d.stateNode.containerInfo;le.nodeType===1?le.textContent="":le.nodeType===9&&le.documentElement&&le.removeChild(le.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(_e){en(d,d.return,_e)}if(l=d.sibling,l!==null){l.return=d.return,je=l;break}je=d.return}return Le=IE,IE=!1,Le}function Wu(l,d,g){var b=d.updateQueue;if(b=b!==null?b.lastEffect:null,b!==null){var _=b=b.next;do{if((_.tag&l)===l){var T=_.destroy;_.destroy=void 0,T!==void 0&&Py(d,g,T)}_=_.next}while(_!==b)}}function Xf(l,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var g=d=d.next;do{if((g.tag&l)===l){var b=g.create;g.destroy=b()}g=g.next}while(g!==d)}}function Ry(l){var d=l.ref;if(d!==null){var g=l.stateNode;switch(l.tag){case 5:l=g;break;default:l=g}typeof d=="function"?d(l):d.current=l}}function jE(l){var d=l.alternate;d!==null&&(l.alternate=null,jE(d)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(d=l.stateNode,d!==null&&(delete d[xi],delete d[Mu],delete d[qg],delete d[mz],delete d[gz])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function LE(l){return l.tag===5||l.tag===3||l.tag===4}function FE(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||LE(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function My(l,d,g){var b=l.tag;if(b===5||b===6)l=l.stateNode,d?g.nodeType===8?g.parentNode.insertBefore(l,d):g.insertBefore(l,d):(g.nodeType===8?(d=g.parentNode,d.insertBefore(l,g)):(d=g,d.appendChild(l)),g=g._reactRootContainer,g!=null||d.onclick!==null||(d.onclick=Tf));else if(b!==4&&(l=l.child,l!==null))for(My(l,d,g),l=l.sibling;l!==null;)My(l,d,g),l=l.sibling}function Dy(l,d,g){var b=l.tag;if(b===5||b===6)l=l.stateNode,d?g.insertBefore(l,d):g.appendChild(l);else if(b!==4&&(l=l.child,l!==null))for(Dy(l,d,g),l=l.sibling;l!==null;)Dy(l,d,g),l=l.sibling}var Mn=null,Qr=!1;function Uo(l,d,g){for(g=g.child;g!==null;)zE(l,d,g),g=g.sibling}function zE(l,d,g){if(Mr&&typeof Mr.onCommitFiberUnmount=="function")try{Mr.onCommitFiberUnmount(Na,g)}catch{}switch(g.tag){case 5:zn||Za(g,d);case 6:var b=Mn,_=Qr;Mn=null,Uo(l,d,g),Mn=b,Qr=_,Mn!==null&&(Qr?(l=Mn,g=g.stateNode,l.nodeType===8?l.parentNode.removeChild(g):l.removeChild(g)):Mn.removeChild(g.stateNode));break;case 18:Mn!==null&&(Qr?(l=Mn,g=g.stateNode,l.nodeType===8?Yg(l.parentNode,g):l.nodeType===1&&Yg(l,g),bu(l)):Yg(Mn,g.stateNode));break;case 4:b=Mn,_=Qr,Mn=g.stateNode.containerInfo,Qr=!0,Uo(l,d,g),Mn=b,Qr=_;break;case 0:case 11:case 14:case 15:if(!zn&&(b=g.updateQueue,b!==null&&(b=b.lastEffect,b!==null))){_=b=b.next;do{var T=_,z=T.destroy;T=T.tag,z!==void 0&&(T&2||T&4)&&Py(g,d,z),_=_.next}while(_!==b)}Uo(l,d,g);break;case 1:if(!zn&&(Za(g,d),b=g.stateNode,typeof b.componentWillUnmount=="function"))try{b.props=g.memoizedProps,b.state=g.memoizedState,b.componentWillUnmount()}catch(X){en(g,d,X)}Uo(l,d,g);break;case 21:Uo(l,d,g);break;case 22:g.mode&1?(zn=(b=zn)||g.memoizedState!==null,Uo(l,d,g),zn=b):Uo(l,d,g);break;default:Uo(l,d,g)}}function $E(l){var d=l.updateQueue;if(d!==null){l.updateQueue=null;var g=l.stateNode;g===null&&(g=l.stateNode=new Mz),d.forEach(function(b){var _=Vz.bind(null,l,b);g.has(b)||(g.add(b),b.then(_,_))})}}function Jr(l,d){var g=d.deletions;if(g!==null)for(var b=0;b<g.length;b++){var _=g[b];try{var T=l,z=d,X=z;e:for(;X!==null;){switch(X.tag){case 5:Mn=X.stateNode,Qr=!1;break e;case 3:Mn=X.stateNode.containerInfo,Qr=!0;break e;case 4:Mn=X.stateNode.containerInfo,Qr=!0;break e}X=X.return}if(Mn===null)throw Error(n(160));zE(T,z,_),Mn=null,Qr=!1;var te=_.alternate;te!==null&&(te.return=null),_.return=null}catch(de){en(_,d,de)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)BE(d,l),d=d.sibling}function BE(l,d){var g=l.alternate,b=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Jr(d,l),ki(l),b&4){try{Wu(3,l,l.return),Xf(3,l)}catch(ze){en(l,l.return,ze)}try{Wu(5,l,l.return)}catch(ze){en(l,l.return,ze)}}break;case 1:Jr(d,l),ki(l),b&512&&g!==null&&Za(g,g.return);break;case 5:if(Jr(d,l),ki(l),b&512&&g!==null&&Za(g,g.return),l.flags&32){var _=l.stateNode;try{tt(_,"")}catch(ze){en(l,l.return,ze)}}if(b&4&&(_=l.stateNode,_!=null)){var T=l.memoizedProps,z=g!==null?g.memoizedProps:T,X=l.type,te=l.updateQueue;if(l.updateQueue=null,te!==null)try{X==="input"&&T.type==="radio"&&T.name!=null&&ct(_,T),yn(X,z);var de=yn(X,T);for(z=0;z<te.length;z+=2){var xe=te[z],we=te[z+1];xe==="style"?at(_,we):xe==="dangerouslySetInnerHTML"?Ke(_,we):xe==="children"?tt(_,we):C(_,xe,we,de)}switch(X){case"input":_t(_,T);break;case"textarea":Ae(_,T);break;case"select":var ye=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!T.multiple;var De=T.value;De!=null?Ce(_,!!T.multiple,De,!1):ye!==!!T.multiple&&(T.defaultValue!=null?Ce(_,!!T.multiple,T.defaultValue,!0):Ce(_,!!T.multiple,T.multiple?[]:"",!1))}_[Mu]=T}catch(ze){en(l,l.return,ze)}}break;case 6:if(Jr(d,l),ki(l),b&4){if(l.stateNode===null)throw Error(n(162));_=l.stateNode,T=l.memoizedProps;try{_.nodeValue=T}catch(ze){en(l,l.return,ze)}}break;case 3:if(Jr(d,l),ki(l),b&4&&g!==null&&g.memoizedState.isDehydrated)try{bu(d.containerInfo)}catch(ze){en(l,l.return,ze)}break;case 4:Jr(d,l),ki(l);break;case 13:Jr(d,l),ki(l),_=l.child,_.flags&8192&&(T=_.memoizedState!==null,_.stateNode.isHidden=T,!T||_.alternate!==null&&_.alternate.memoizedState!==null||(jy=Gt())),b&4&&$E(l);break;case 22:if(xe=g!==null&&g.memoizedState!==null,l.mode&1?(zn=(de=zn)||xe,Jr(d,l),zn=de):Jr(d,l),ki(l),b&8192){if(de=l.memoizedState!==null,(l.stateNode.isHidden=de)&&!xe&&l.mode&1)for(je=l,xe=l.child;xe!==null;){for(we=je=xe;je!==null;){switch(ye=je,De=ye.child,ye.tag){case 0:case 11:case 14:case 15:Wu(4,ye,ye.return);break;case 1:Za(ye,ye.return);var Le=ye.stateNode;if(typeof Le.componentWillUnmount=="function"){b=ye,g=ye.return;try{d=b,Le.props=d.memoizedProps,Le.state=d.memoizedState,Le.componentWillUnmount()}catch(ze){en(b,g,ze)}}break;case 5:Za(ye,ye.return);break;case 22:if(ye.memoizedState!==null){UE(we);continue}}De!==null?(De.return=ye,je=De):UE(we)}xe=xe.sibling}e:for(xe=null,we=l;;){if(we.tag===5){if(xe===null){xe=we;try{_=we.stateNode,de?(T=_.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none"):(X=we.stateNode,te=we.memoizedProps.style,z=te!=null&&te.hasOwnProperty("display")?te.display:null,X.style.display=it("display",z))}catch(ze){en(l,l.return,ze)}}}else if(we.tag===6){if(xe===null)try{we.stateNode.nodeValue=de?"":we.memoizedProps}catch(ze){en(l,l.return,ze)}}else if((we.tag!==22&&we.tag!==23||we.memoizedState===null||we===l)&&we.child!==null){we.child.return=we,we=we.child;continue}if(we===l)break e;for(;we.sibling===null;){if(we.return===null||we.return===l)break e;xe===we&&(xe=null),we=we.return}xe===we&&(xe=null),we.sibling.return=we.return,we=we.sibling}}break;case 19:Jr(d,l),ki(l),b&4&&$E(l);break;case 21:break;default:Jr(d,l),ki(l)}}function ki(l){var d=l.flags;if(d&2){try{e:{for(var g=l.return;g!==null;){if(LE(g)){var b=g;break e}g=g.return}throw Error(n(160))}switch(b.tag){case 5:var _=b.stateNode;b.flags&32&&(tt(_,""),b.flags&=-33);var T=FE(l);Dy(l,T,_);break;case 3:case 4:var z=b.stateNode.containerInfo,X=FE(l);My(l,X,z);break;default:throw Error(n(161))}}catch(te){en(l,l.return,te)}l.flags&=-3}d&4096&&(l.flags&=-4097)}function Oz(l,d,g){je=l,VE(l)}function VE(l,d,g){for(var b=(l.mode&1)!==0;je!==null;){var _=je,T=_.child;if(_.tag===22&&b){var z=_.memoizedState!==null||Kf;if(!z){var X=_.alternate,te=X!==null&&X.memoizedState!==null||zn;X=Kf;var de=zn;if(Kf=z,(zn=te)&&!de)for(je=_;je!==null;)z=je,te=z.child,z.tag===22&&z.memoizedState!==null?HE(_):te!==null?(te.return=z,je=te):HE(_);for(;T!==null;)je=T,VE(T),T=T.sibling;je=_,Kf=X,zn=de}WE(l)}else _.subtreeFlags&8772&&T!==null?(T.return=_,je=T):WE(l)}}function WE(l){for(;je!==null;){var d=je;if(d.flags&8772){var g=d.alternate;try{if(d.flags&8772)switch(d.tag){case 0:case 11:case 15:zn||Xf(5,d);break;case 1:var b=d.stateNode;if(d.flags&4&&!zn)if(g===null)b.componentDidMount();else{var _=d.elementType===d.type?g.memoizedProps:Xr(d.type,g.memoizedProps);b.componentDidUpdate(_,g.memoizedState,b.__reactInternalSnapshotBeforeUpdate)}var T=d.updateQueue;T!==null&&US(d,T,b);break;case 3:var z=d.updateQueue;if(z!==null){if(g=null,d.child!==null)switch(d.child.tag){case 5:g=d.child.stateNode;break;case 1:g=d.child.stateNode}US(d,z,g)}break;case 5:var X=d.stateNode;if(g===null&&d.flags&4){g=X;var te=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&g.focus();break;case"img":te.src&&(g.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var de=d.alternate;if(de!==null){var xe=de.memoizedState;if(xe!==null){var we=xe.dehydrated;we!==null&&bu(we)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}zn||d.flags&512&&Ry(d)}catch(ye){en(d,d.return,ye)}}if(d===l){je=null;break}if(g=d.sibling,g!==null){g.return=d.return,je=g;break}je=d.return}}function UE(l){for(;je!==null;){var d=je;if(d===l){je=null;break}var g=d.sibling;if(g!==null){g.return=d.return,je=g;break}je=d.return}}function HE(l){for(;je!==null;){var d=je;try{switch(d.tag){case 0:case 11:case 15:var g=d.return;try{Xf(4,d)}catch(te){en(d,g,te)}break;case 1:var b=d.stateNode;if(typeof b.componentDidMount=="function"){var _=d.return;try{b.componentDidMount()}catch(te){en(d,_,te)}}var T=d.return;try{Ry(d)}catch(te){en(d,T,te)}break;case 5:var z=d.return;try{Ry(d)}catch(te){en(d,z,te)}}}catch(te){en(d,d.return,te)}if(d===l){je=null;break}var X=d.sibling;if(X!==null){X.return=d.return,je=X;break}je=d.return}}var Iz=Math.ceil,Qf=N.ReactCurrentDispatcher,Oy=N.ReactCurrentOwner,Lr=N.ReactCurrentBatchConfig,wt=0,_n=null,ln=null,Dn=0,vr=0,Ka=zo(0),wn=0,Uu=null,zs=0,Jf=0,Iy=0,Hu=null,sr=null,jy=0,Xa=1/0,to=null,eh=!1,Ly=null,Ho=null,th=!1,Yo=null,nh=0,Yu=0,Fy=null,rh=-1,ih=0;function Zn(){return wt&6?Gt():rh!==-1?rh:rh=Gt()}function qo(l){return l.mode&1?wt&2&&Dn!==0?Dn&-Dn:vz.transition!==null?(ih===0&&(ih=Fk()),ih):(l=Nt,l!==0||(l=window.event,l=l===void 0?16:qk(l.type)),l):1}function ei(l,d,g,b){if(50<Yu)throw Yu=0,Fy=null,Error(n(185));gu(l,g,b),(!(wt&2)||l!==_n)&&(l===_n&&(!(wt&2)&&(Jf|=g),wn===4&&Go(l,Dn)),ar(l,b),g===1&&wt===0&&!(d.mode&1)&&(Xa=Gt()+500,Mf&&Bo()))}function ar(l,d){var g=l.callbackNode;v3(l,d);var b=Pa(l,l===_n?Dn:0);if(b===0)g!==null&&df(g),l.callbackNode=null,l.callbackPriority=0;else if(d=b&-b,l.callbackPriority!==d){if(g!=null&&df(g),d===1)l.tag===0?yz(qE.bind(null,l)):MS(qE.bind(null,l)),hz(function(){!(wt&6)&&Bo()}),g=null;else{switch(zk(b)){case 1:g=pu;break;case 4:g=hf;break;case 16:g=_a;break;case 536870912:g=mu;break;default:g=_a}g=tC(g,YE.bind(null,l))}l.callbackPriority=d,l.callbackNode=g}}function YE(l,d){if(rh=-1,ih=0,wt&6)throw Error(n(327));var g=l.callbackNode;if(Qa()&&l.callbackNode!==g)return null;var b=Pa(l,l===_n?Dn:0);if(b===0)return null;if(b&30||b&l.expiredLanes||d)d=oh(l,b);else{d=b;var _=wt;wt|=2;var T=ZE();(_n!==l||Dn!==d)&&(to=null,Xa=Gt()+500,Bs(l,d));do try{Fz();break}catch(X){GE(l,X)}while(!0);ny(),Qf.current=T,wt=_,ln!==null?d=0:(_n=null,Dn=0,d=wn)}if(d!==0){if(d===2&&(_=vg(l),_!==0&&(b=_,d=zy(l,_))),d===1)throw g=Uu,Bs(l,0),Go(l,b),ar(l,Gt()),g;if(d===6)Go(l,b);else{if(_=l.current.alternate,!(b&30)&&!jz(_)&&(d=oh(l,b),d===2&&(T=vg(l),T!==0&&(b=T,d=zy(l,T))),d===1))throw g=Uu,Bs(l,0),Go(l,b),ar(l,Gt()),g;switch(l.finishedWork=_,l.finishedLanes=b,d){case 0:case 1:throw Error(n(345));case 2:Vs(l,sr,to);break;case 3:if(Go(l,b),(b&130023424)===b&&(d=jy+500-Gt(),10<d)){if(Pa(l,0)!==0)break;if(_=l.suspendedLanes,(_&b)!==b){Zn(),l.pingedLanes|=l.suspendedLanes&_;break}l.timeoutHandle=Hg(Vs.bind(null,l,sr,to),d);break}Vs(l,sr,to);break;case 4:if(Go(l,b),(b&4194240)===b)break;for(d=l.eventTimes,_=-1;0<b;){var z=31-pr(b);T=1<<z,z=d[z],z>_&&(_=z),b&=~T}if(b=_,b=Gt()-b,b=(120>b?120:480>b?480:1080>b?1080:1920>b?1920:3e3>b?3e3:4320>b?4320:1960*Iz(b/1960))-b,10<b){l.timeoutHandle=Hg(Vs.bind(null,l,sr,to),b);break}Vs(l,sr,to);break;case 5:Vs(l,sr,to);break;default:throw Error(n(329))}}}return ar(l,Gt()),l.callbackNode===g?YE.bind(null,l):null}function zy(l,d){var g=Hu;return l.current.memoizedState.isDehydrated&&(Bs(l,d).flags|=256),l=oh(l,d),l!==2&&(d=sr,sr=g,d!==null&&$y(d)),l}function $y(l){sr===null?sr=l:sr.push.apply(sr,l)}function jz(l){for(var d=l;;){if(d.flags&16384){var g=d.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var b=0;b<g.length;b++){var _=g[b],T=_.getSnapshot;_=_.value;try{if(!Zr(T(),_))return!1}catch{return!1}}}if(g=d.child,d.subtreeFlags&16384&&g!==null)g.return=d,d=g;else{if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Go(l,d){for(d&=~Iy,d&=~Jf,l.suspendedLanes|=d,l.pingedLanes&=~d,l=l.expirationTimes;0<d;){var g=31-pr(d),b=1<<g;l[g]=-1,d&=~b}}function qE(l){if(wt&6)throw Error(n(327));Qa();var d=Pa(l,0);if(!(d&1))return ar(l,Gt()),null;var g=oh(l,d);if(l.tag!==0&&g===2){var b=vg(l);b!==0&&(d=b,g=zy(l,b))}if(g===1)throw g=Uu,Bs(l,0),Go(l,d),ar(l,Gt()),g;if(g===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=d,Vs(l,sr,to),ar(l,Gt()),null}function By(l,d){var g=wt;wt|=1;try{return l(d)}finally{wt=g,wt===0&&(Xa=Gt()+500,Mf&&Bo())}}function $s(l){Yo!==null&&Yo.tag===0&&!(wt&6)&&Qa();var d=wt;wt|=1;var g=Lr.transition,b=Nt;try{if(Lr.transition=null,Nt=1,l)return l()}finally{Nt=b,Lr.transition=g,wt=d,!(wt&6)&&Bo()}}function Vy(){vr=Ka.current,Ft(Ka)}function Bs(l,d){l.finishedWork=null,l.finishedLanes=0;var g=l.timeoutHandle;if(g!==-1&&(l.timeoutHandle=-1,fz(g)),ln!==null)for(g=ln.return;g!==null;){var b=g;switch(Xg(b),b.tag){case 1:b=b.type.childContextTypes,b!=null&&Pf();break;case 3:qa(),Ft(rr),Ft(jn),cy();break;case 5:ly(b);break;case 4:qa();break;case 13:Ft(Zt);break;case 19:Ft(Zt);break;case 10:ry(b.type._context);break;case 22:case 23:Vy()}g=g.return}if(_n=l,ln=l=Zo(l.current,null),Dn=vr=d,wn=0,Uu=null,Iy=Jf=zs=0,sr=Hu=null,js!==null){for(d=0;d<js.length;d++)if(g=js[d],b=g.interleaved,b!==null){g.interleaved=null;var _=b.next,T=g.pending;if(T!==null){var z=T.next;T.next=_,b.next=z}g.pending=b}js=null}return l}function GE(l,d){do{var g=ln;try{if(ny(),Vf.current=Yf,Wf){for(var b=Kt.memoizedState;b!==null;){var _=b.queue;_!==null&&(_.pending=null),b=b.next}Wf=!1}if(Fs=0,Cn=xn=Kt=null,Fu=!1,zu=0,Oy.current=null,g===null||g.return===null){wn=1,Uu=d,ln=null;break}e:{var T=l,z=g.return,X=g,te=d;if(d=Dn,X.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var de=te,xe=X,we=xe.tag;if(!(xe.mode&1)&&(we===0||we===11||we===15)){var ye=xe.alternate;ye?(xe.updateQueue=ye.updateQueue,xe.memoizedState=ye.memoizedState,xe.lanes=ye.lanes):(xe.updateQueue=null,xe.memoizedState=null)}var De=xE(z);if(De!==null){De.flags&=-257,wE(De,z,X,T,d),De.mode&1&&vE(T,de,d),d=De,te=de;var Le=d.updateQueue;if(Le===null){var ze=new Set;ze.add(te),d.updateQueue=ze}else Le.add(te);break e}else{if(!(d&1)){vE(T,de,d),Wy();break e}te=Error(n(426))}}else if(Ut&&X.mode&1){var on=xE(z);if(on!==null){!(on.flags&65536)&&(on.flags|=256),wE(on,z,X,T,d),ey(Ga(te,X));break e}}T=te=Ga(te,X),wn!==4&&(wn=2),Hu===null?Hu=[T]:Hu.push(T),T=z;do{switch(T.tag){case 3:T.flags|=65536,d&=-d,T.lanes|=d;var se=gE(T,te,d);WS(T,se);break e;case 1:X=te;var ie=T.type,le=T.stateNode;if(!(T.flags&128)&&(typeof ie.getDerivedStateFromError=="function"||le!==null&&typeof le.componentDidCatch=="function"&&(Ho===null||!Ho.has(le)))){T.flags|=65536,d&=-d,T.lanes|=d;var _e=yE(T,X,d);WS(T,_e);break e}}T=T.return}while(T!==null)}XE(g)}catch(Be){d=Be,ln===g&&g!==null&&(ln=g=g.return);continue}break}while(!0)}function ZE(){var l=Qf.current;return Qf.current=Yf,l===null?Yf:l}function Wy(){(wn===0||wn===3||wn===2)&&(wn=4),_n===null||!(zs&268435455)&&!(Jf&268435455)||Go(_n,Dn)}function oh(l,d){var g=wt;wt|=2;var b=ZE();(_n!==l||Dn!==d)&&(to=null,Bs(l,d));do try{Lz();break}catch(_){GE(l,_)}while(!0);if(ny(),wt=g,Qf.current=b,ln!==null)throw Error(n(261));return _n=null,Dn=0,wn}function Lz(){for(;ln!==null;)KE(ln)}function Fz(){for(;ln!==null&&!ff();)KE(ln)}function KE(l){var d=eC(l.alternate,l,vr);l.memoizedProps=l.pendingProps,d===null?XE(l):ln=d,Oy.current=null}function XE(l){var d=l;do{var g=d.alternate;if(l=d.return,d.flags&32768){if(g=Rz(g,d),g!==null){g.flags&=32767,ln=g;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{wn=6,ln=null;return}}else if(g=Pz(g,d,vr),g!==null){ln=g;return}if(d=d.sibling,d!==null){ln=d;return}ln=d=l}while(d!==null);wn===0&&(wn=5)}function Vs(l,d,g){var b=Nt,_=Lr.transition;try{Lr.transition=null,Nt=1,zz(l,d,g,b)}finally{Lr.transition=_,Nt=b}return null}function zz(l,d,g,b){do Qa();while(Yo!==null);if(wt&6)throw Error(n(327));g=l.finishedWork;var _=l.finishedLanes;if(g===null)return null;if(l.finishedWork=null,l.finishedLanes=0,g===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var T=g.lanes|g.childLanes;if(x3(l,T),l===_n&&(ln=_n=null,Dn=0),!(g.subtreeFlags&2064)&&!(g.flags&2064)||th||(th=!0,tC(_a,function(){return Qa(),null})),T=(g.flags&15990)!==0,g.subtreeFlags&15990||T){T=Lr.transition,Lr.transition=null;var z=Nt;Nt=1;var X=wt;wt|=4,Oy.current=null,Dz(l,g),BE(g,l),oz(Wg),gf=!!Vg,Wg=Vg=null,l.current=g,Oz(g),dg(),wt=X,Nt=z,Lr.transition=T}else l.current=g;if(th&&(th=!1,Yo=l,nh=_),T=l.pendingLanes,T===0&&(Ho=null),pg(g.stateNode),ar(l,Gt()),d!==null)for(b=l.onRecoverableError,g=0;g<d.length;g++)_=d[g],b(_.value,{componentStack:_.stack,digest:_.digest});if(eh)throw eh=!1,l=Ly,Ly=null,l;return nh&1&&l.tag!==0&&Qa(),T=l.pendingLanes,T&1?l===Fy?Yu++:(Yu=0,Fy=l):Yu=0,Bo(),null}function Qa(){if(Yo!==null){var l=zk(nh),d=Lr.transition,g=Nt;try{if(Lr.transition=null,Nt=16>l?16:l,Yo===null)var b=!1;else{if(l=Yo,Yo=null,nh=0,wt&6)throw Error(n(331));var _=wt;for(wt|=4,je=l.current;je!==null;){var T=je,z=T.child;if(je.flags&16){var X=T.deletions;if(X!==null){for(var te=0;te<X.length;te++){var de=X[te];for(je=de;je!==null;){var xe=je;switch(xe.tag){case 0:case 11:case 15:Wu(8,xe,T)}var we=xe.child;if(we!==null)we.return=xe,je=we;else for(;je!==null;){xe=je;var ye=xe.sibling,De=xe.return;if(jE(xe),xe===de){je=null;break}if(ye!==null){ye.return=De,je=ye;break}je=De}}}var Le=T.alternate;if(Le!==null){var ze=Le.child;if(ze!==null){Le.child=null;do{var on=ze.sibling;ze.sibling=null,ze=on}while(ze!==null)}}je=T}}if(T.subtreeFlags&2064&&z!==null)z.return=T,je=z;else e:for(;je!==null;){if(T=je,T.flags&2048)switch(T.tag){case 0:case 11:case 15:Wu(9,T,T.return)}var se=T.sibling;if(se!==null){se.return=T.return,je=se;break e}je=T.return}}var ie=l.current;for(je=ie;je!==null;){z=je;var le=z.child;if(z.subtreeFlags&2064&&le!==null)le.return=z,je=le;else e:for(z=ie;je!==null;){if(X=je,X.flags&2048)try{switch(X.tag){case 0:case 11:case 15:Xf(9,X)}}catch(Be){en(X,X.return,Be)}if(X===z){je=null;break e}var _e=X.sibling;if(_e!==null){_e.return=X.return,je=_e;break e}je=X.return}}if(wt=_,Bo(),Mr&&typeof Mr.onPostCommitFiberRoot=="function")try{Mr.onPostCommitFiberRoot(Na,l)}catch{}b=!0}return b}finally{Nt=g,Lr.transition=d}}return!1}function QE(l,d,g){d=Ga(g,d),d=gE(l,d,1),l=Wo(l,d,1),d=Zn(),l!==null&&(gu(l,1,d),ar(l,d))}function en(l,d,g){if(l.tag===3)QE(l,l,g);else for(;d!==null;){if(d.tag===3){QE(d,l,g);break}else if(d.tag===1){var b=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(Ho===null||!Ho.has(b))){l=Ga(g,l),l=yE(d,l,1),d=Wo(d,l,1),l=Zn(),d!==null&&(gu(d,1,l),ar(d,l));break}}d=d.return}}function $z(l,d,g){var b=l.pingCache;b!==null&&b.delete(d),d=Zn(),l.pingedLanes|=l.suspendedLanes&g,_n===l&&(Dn&g)===g&&(wn===4||wn===3&&(Dn&130023424)===Dn&&500>Gt()-jy?Bs(l,0):Iy|=g),ar(l,d)}function JE(l,d){d===0&&(l.mode&1?(d=Aa,Aa<<=1,!(Aa&130023424)&&(Aa=4194304)):d=1);var g=Zn();l=Qi(l,d),l!==null&&(gu(l,d,g),ar(l,g))}function Bz(l){var d=l.memoizedState,g=0;d!==null&&(g=d.retryLane),JE(l,g)}function Vz(l,d){var g=0;switch(l.tag){case 13:var b=l.stateNode,_=l.memoizedState;_!==null&&(g=_.retryLane);break;case 19:b=l.stateNode;break;default:throw Error(n(314))}b!==null&&b.delete(d),JE(l,g)}var eC;eC=function(l,d,g){if(l!==null)if(l.memoizedProps!==d.pendingProps||rr.current)or=!0;else{if(!(l.lanes&g)&&!(d.flags&128))return or=!1,Az(l,d,g);or=!!(l.flags&131072)}else or=!1,Ut&&d.flags&1048576&&DS(d,Of,d.index);switch(d.lanes=0,d.tag){case 2:var b=d.type;Zf(l,d),l=d.pendingProps;var _=$a(d,jn.current);Ya(d,g),_=hy(null,d,b,l,_,g);var T=py();return d.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,ir(b)?(T=!0,Rf(d)):T=!1,d.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,sy(d),_.updater=qf,d.stateNode=_,_._reactInternals=d,wy(d,b,l,g),d=Ey(null,d,b,!0,T,g)):(d.tag=0,Ut&&T&&Kg(d),Gn(null,d,_,g),d=d.child),d;case 16:b=d.elementType;e:{switch(Zf(l,d),l=d.pendingProps,_=b._init,b=_(b._payload),d.type=b,_=d.tag=Uz(b),l=Xr(b,l),_){case 0:d=Sy(null,d,b,l,g);break e;case 1:d=_E(null,d,b,l,g);break e;case 11:d=bE(null,d,b,l,g);break e;case 14:d=kE(null,d,b,Xr(b.type,l),g);break e}throw Error(n(306,b,""))}return d;case 0:return b=d.type,_=d.pendingProps,_=d.elementType===b?_:Xr(b,_),Sy(l,d,b,_,g);case 1:return b=d.type,_=d.pendingProps,_=d.elementType===b?_:Xr(b,_),_E(l,d,b,_,g);case 3:e:{if(NE(d),l===null)throw Error(n(387));b=d.pendingProps,T=d.memoizedState,_=T.element,VS(l,d),$f(d,b,null,g);var z=d.memoizedState;if(b=z.element,T.isDehydrated)if(T={element:b,isDehydrated:!1,cache:z.cache,pendingSuspenseBoundaries:z.pendingSuspenseBoundaries,transitions:z.transitions},d.updateQueue.baseState=T,d.memoizedState=T,d.flags&256){_=Ga(Error(n(423)),d),d=TE(l,d,b,g,_);break e}else if(b!==_){_=Ga(Error(n(424)),d),d=TE(l,d,b,g,_);break e}else for(yr=Fo(d.stateNode.containerInfo.firstChild),gr=d,Ut=!0,Kr=null,g=$S(d,null,b,g),d.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(Wa(),b===_){d=eo(l,d,g);break e}Gn(l,d,b,g)}d=d.child}return d;case 5:return HS(d),l===null&&Jg(d),b=d.type,_=d.pendingProps,T=l!==null?l.memoizedProps:null,z=_.children,Ug(b,_)?z=null:T!==null&&Ug(b,T)&&(d.flags|=32),CE(l,d),Gn(l,d,z,g),d.child;case 6:return l===null&&Jg(d),null;case 13:return AE(l,d,g);case 4:return ay(d,d.stateNode.containerInfo),b=d.pendingProps,l===null?d.child=Ua(d,null,b,g):Gn(l,d,b,g),d.child;case 11:return b=d.type,_=d.pendingProps,_=d.elementType===b?_:Xr(b,_),bE(l,d,b,_,g);case 7:return Gn(l,d,d.pendingProps,g),d.child;case 8:return Gn(l,d,d.pendingProps.children,g),d.child;case 12:return Gn(l,d,d.pendingProps.children,g),d.child;case 10:e:{if(b=d.type._context,_=d.pendingProps,T=d.memoizedProps,z=_.value,Mt(Lf,b._currentValue),b._currentValue=z,T!==null)if(Zr(T.value,z)){if(T.children===_.children&&!rr.current){d=eo(l,d,g);break e}}else for(T=d.child,T!==null&&(T.return=d);T!==null;){var X=T.dependencies;if(X!==null){z=T.child;for(var te=X.firstContext;te!==null;){if(te.context===b){if(T.tag===1){te=Ji(-1,g&-g),te.tag=2;var de=T.updateQueue;if(de!==null){de=de.shared;var xe=de.pending;xe===null?te.next=te:(te.next=xe.next,xe.next=te),de.pending=te}}T.lanes|=g,te=T.alternate,te!==null&&(te.lanes|=g),iy(T.return,g,d),X.lanes|=g;break}te=te.next}}else if(T.tag===10)z=T.type===d.type?null:T.child;else if(T.tag===18){if(z=T.return,z===null)throw Error(n(341));z.lanes|=g,X=z.alternate,X!==null&&(X.lanes|=g),iy(z,g,d),z=T.sibling}else z=T.child;if(z!==null)z.return=T;else for(z=T;z!==null;){if(z===d){z=null;break}if(T=z.sibling,T!==null){T.return=z.return,z=T;break}z=z.return}T=z}Gn(l,d,_.children,g),d=d.child}return d;case 9:return _=d.type,b=d.pendingProps.children,Ya(d,g),_=Ir(_),b=b(_),d.flags|=1,Gn(l,d,b,g),d.child;case 14:return b=d.type,_=Xr(b,d.pendingProps),_=Xr(b.type,_),kE(l,d,b,_,g);case 15:return SE(l,d,d.type,d.pendingProps,g);case 17:return b=d.type,_=d.pendingProps,_=d.elementType===b?_:Xr(b,_),Zf(l,d),d.tag=1,ir(b)?(l=!0,Rf(d)):l=!1,Ya(d,g),pE(d,b,_),wy(d,b,_,g),Ey(null,d,b,!0,l,g);case 19:return RE(l,d,g);case 22:return EE(l,d,g)}throw Error(n(156,d.tag))};function tC(l,d){return cf(l,d)}function Wz(l,d,g,b){this.tag=l,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fr(l,d,g,b){return new Wz(l,d,g,b)}function Uy(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Uz(l){if(typeof l=="function")return Uy(l)?1:0;if(l!=null){if(l=l.$$typeof,l===F)return 11;if(l===Y)return 14}return 2}function Zo(l,d){var g=l.alternate;return g===null?(g=Fr(l.tag,d,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=d,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&14680064,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,d=l.dependencies,g.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g}function sh(l,d,g,b,_,T){var z=2;if(b=l,typeof l=="function")Uy(l)&&(z=1);else if(typeof l=="string")z=5;else e:switch(l){case O:return Ws(g.children,_,T,d);case M:z=8,_|=8;break;case j:return l=Fr(12,g,d,_|2),l.elementType=j,l.lanes=T,l;case H:return l=Fr(13,g,d,_),l.elementType=H,l.lanes=T,l;case I:return l=Fr(19,g,d,_),l.elementType=I,l.lanes=T,l;case Z:return ah(g,_,T,d);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case R:z=10;break e;case $:z=9;break e;case F:z=11;break e;case Y:z=14;break e;case q:z=16,b=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return d=Fr(z,g,d,_),d.elementType=l,d.type=b,d.lanes=T,d}function Ws(l,d,g,b){return l=Fr(7,l,b,d),l.lanes=g,l}function ah(l,d,g,b){return l=Fr(22,l,b,d),l.elementType=Z,l.lanes=g,l.stateNode={isHidden:!1},l}function Hy(l,d,g){return l=Fr(6,l,null,d),l.lanes=g,l}function Yy(l,d,g){return d=Fr(4,l.children!==null?l.children:[],l.key,d),d.lanes=g,d.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},d}function Hz(l,d,g,b,_){this.tag=d,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xg(0),this.expirationTimes=xg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xg(0),this.identifierPrefix=b,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function qy(l,d,g,b,_,T,z,X,te){return l=new Hz(l,d,g,X,te),d===1?(d=1,T===!0&&(d|=8)):d=0,T=Fr(3,null,null,d),l.current=T,T.stateNode=l,T.memoizedState={element:b,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},sy(T),l}function Yz(l,d,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:b==null?null:""+b,children:l,containerInfo:d,implementation:g}}function nC(l){if(!l)return $o;l=l._reactInternals;e:{if(vi(l)!==l||l.tag!==1)throw Error(n(170));var d=l;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(ir(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(n(171))}if(l.tag===1){var g=l.type;if(ir(g))return PS(l,g,d)}return d}function rC(l,d,g,b,_,T,z,X,te){return l=qy(g,b,!0,l,_,T,z,X,te),l.context=nC(null),g=l.current,b=Zn(),_=qo(g),T=Ji(b,_),T.callback=d??null,Wo(g,T,_),l.current.lanes=_,gu(l,_,b),ar(l,b),l}function lh(l,d,g,b){var _=d.current,T=Zn(),z=qo(_);return g=nC(g),d.context===null?d.context=g:d.pendingContext=g,d=Ji(T,z),d.payload={element:l},b=b===void 0?null:b,b!==null&&(d.callback=b),l=Wo(_,d,z),l!==null&&(ei(l,_,z,T),zf(l,_,z)),z}function uh(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function iC(l,d){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<d?g:d}}function Gy(l,d){iC(l,d),(l=l.alternate)&&iC(l,d)}var oC=typeof reportError=="function"?reportError:function(l){console.error(l)};function Zy(l){this._internalRoot=l}ch.prototype.render=Zy.prototype.render=function(l){var d=this._internalRoot;if(d===null)throw Error(n(409));lh(l,d,null,null)},ch.prototype.unmount=Zy.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var d=l.containerInfo;$s(function(){lh(null,l,null,null)}),d[Gi]=null}};function ch(l){this._internalRoot=l}ch.prototype.unstable_scheduleHydration=function(l){if(l){var d=Vk();l={blockedOn:null,target:l,priority:d};for(var g=0;g<Io.length&&d!==0&&d<Io[g].priority;g++);Io.splice(g,0,l),g===0&&Hk(l)}};function Ky(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function dh(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function sC(){}function qz(l,d,g,b,_){if(_){if(typeof b=="function"){var T=b;b=function(){var de=uh(z);T.call(de)}}var z=rC(d,b,l,0,null,!1,!1,"",sC);return l._reactRootContainer=z,l[Gi]=z.current,Pu(l.nodeType===8?l.parentNode:l),$s(),z}for(;_=l.lastChild;)l.removeChild(_);if(typeof b=="function"){var X=b;b=function(){var de=uh(te);X.call(de)}}var te=qy(l,0,!1,null,null,!1,!1,"",sC);return l._reactRootContainer=te,l[Gi]=te.current,Pu(l.nodeType===8?l.parentNode:l),$s(function(){lh(d,te,g,b)}),te}function fh(l,d,g,b,_){var T=g._reactRootContainer;if(T){var z=T;if(typeof _=="function"){var X=_;_=function(){var te=uh(z);X.call(te)}}lh(d,z,l,_)}else z=qz(g,d,l,_,b);return uh(z)}$k=function(l){switch(l.tag){case 3:var d=l.stateNode;if(d.current.memoizedState.isDehydrated){var g=qi(d.pendingLanes);g!==0&&(wg(d,g|1),ar(d,Gt()),!(wt&6)&&(Xa=Gt()+500,Bo()))}break;case 13:$s(function(){var b=Qi(l,1);if(b!==null){var _=Zn();ei(b,l,1,_)}}),Gy(l,1)}},bg=function(l){if(l.tag===13){var d=Qi(l,134217728);if(d!==null){var g=Zn();ei(d,l,134217728,g)}Gy(l,134217728)}},Bk=function(l){if(l.tag===13){var d=qo(l),g=Qi(l,d);if(g!==null){var b=Zn();ei(g,l,d,b)}Gy(l,d)}},Vk=function(){return Nt},Wk=function(l,d){var g=Nt;try{return Nt=l,d()}finally{Nt=g}},ft=function(l,d,g){switch(d){case"input":if(_t(l,g),d=g.name,g.type==="radio"&&d!=null){for(g=l;g.parentNode;)g=g.parentNode;for(g=g.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<g.length;d++){var b=g[d];if(b!==l&&b.form===l.form){var _=Af(b);if(!_)throw Error(n(90));fe(b),_t(b,_)}}}break;case"textarea":Ae(l,g);break;case"select":d=g.value,d!=null&&Ce(l,!!g.multiple,d,!1)}},Yi=By,Sa=$s;var Gz={usingClientEntryPoint:!1,Events:[Du,Fa,Af,rn,vn,By]},qu={findFiberByHostInstance:Ms,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Zz={bundleType:qu.bundleType,version:qu.version,rendererPackageName:qu.rendererPackageName,rendererConfig:qu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:N.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=lf(l),l===null?null:l.stateNode},findFiberByHostInstance:qu.findFiberByHostInstance,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hh.isDisabled&&hh.supportsFiber)try{Na=hh.inject(Zz),Mr=hh}catch{}}return lr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Gz,lr.createPortal=function(l,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ky(d))throw Error(n(200));return Yz(l,d,null,g)},lr.createRoot=function(l,d){if(!Ky(l))throw Error(n(299));var g=!1,b="",_=oC;return d!=null&&(d.unstable_strictMode===!0&&(g=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onRecoverableError!==void 0&&(_=d.onRecoverableError)),d=qy(l,1,!1,null,null,g,!1,b,_),l[Gi]=d.current,Pu(l.nodeType===8?l.parentNode:l),new Zy(d)},lr.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var d=l._reactInternals;if(d===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=lf(d),l=l===null?null:l.stateNode,l},lr.flushSync=function(l){return $s(l)},lr.hydrate=function(l,d,g){if(!dh(d))throw Error(n(200));return fh(null,l,d,!0,g)},lr.hydrateRoot=function(l,d,g){if(!Ky(l))throw Error(n(405));var b=g!=null&&g.hydratedSources||null,_=!1,T="",z=oC;if(g!=null&&(g.unstable_strictMode===!0&&(_=!0),g.identifierPrefix!==void 0&&(T=g.identifierPrefix),g.onRecoverableError!==void 0&&(z=g.onRecoverableError)),d=rC(d,null,l,1,g??null,_,!1,T,z),l[Gi]=d.current,Pu(l),b)for(l=0;l<b.length;l++)g=b[l],_=g._getVersion,_=_(g._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[g,_]:d.mutableSourceEagerHydrationData.push(g,_);return new ch(d)},lr.render=function(l,d,g){if(!dh(d))throw Error(n(200));return fh(null,l,d,!1,g)},lr.unmountComponentAtNode=function(l){if(!dh(l))throw Error(n(40));return l._reactRootContainer?($s(function(){fh(null,null,l,!1,function(){l._reactRootContainer=null,l[Gi]=null})}),!0):!1},lr.unstable_batchedUpdates=By,lr.unstable_renderSubtreeIntoContainer=function(l,d,g,b){if(!dh(g))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return fh(l,d,g,!1,b)},lr.version="18.3.1-next-f1338f8080-20240426",lr}var pC;function qP(){if(pC)return Jy.exports;pC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Jy.exports=s$(),Jy.exports}var mC;function a$(){if(mC)return ph;mC=1;var e=qP();return ph.createRoot=e.createRoot,ph.hydrateRoot=e.hydrateRoot,ph}var l$=a$(),Zu={},gC;function u$(){if(gC)return Zu;gC=1,Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.parse=s,Zu.serialize=c;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,o=(()=>{const p=function(){};return p.prototype=Object.create(null),p})();function s(p,m){const y=new o,x=p.length;if(x<2)return y;const k=(m==null?void 0:m.decode)||f;let w=0;do{const E=p.indexOf("=",w);if(E===-1)break;const C=p.indexOf(";",w),N=C===-1?x:C;if(E>N){w=p.lastIndexOf(";",E-1)+1;continue}const P=a(p,w,E),A=u(p,E,P),O=p.slice(P,A);if(y[O]===void 0){let M=a(p,E+1,N),j=u(p,N,M);const R=k(p.slice(M,j));y[O]=R}w=N+1}while(w<x);return y}function a(p,m,y){do{const x=p.charCodeAt(m);if(x!==32&&x!==9)return m}while(++m<y);return y}function u(p,m,y){for(;m>y;){const x=p.charCodeAt(--m);if(x!==32&&x!==9)return m+1}return y}function c(p,m,y){const x=(y==null?void 0:y.encode)||encodeURIComponent;if(!e.test(p))throw new TypeError(`argument name is invalid: ${p}`);const k=x(m);if(!t.test(k))throw new TypeError(`argument val is invalid: ${m}`);let w=p+"="+k;if(!y)return w;if(y.maxAge!==void 0){if(!Number.isInteger(y.maxAge))throw new TypeError(`option maxAge is invalid: ${y.maxAge}`);w+="; Max-Age="+y.maxAge}if(y.domain){if(!n.test(y.domain))throw new TypeError(`option domain is invalid: ${y.domain}`);w+="; Domain="+y.domain}if(y.path){if(!r.test(y.path))throw new TypeError(`option path is invalid: ${y.path}`);w+="; Path="+y.path}if(y.expires){if(!h(y.expires)||!Number.isFinite(y.expires.valueOf()))throw new TypeError(`option expires is invalid: ${y.expires}`);w+="; Expires="+y.expires.toUTCString()}if(y.httpOnly&&(w+="; HttpOnly"),y.secure&&(w+="; Secure"),y.partitioned&&(w+="; Partitioned"),y.priority)switch(typeof y.priority=="string"?y.priority.toLowerCase():void 0){case"low":w+="; Priority=Low";break;case"medium":w+="; Priority=Medium";break;case"high":w+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${y.priority}`)}if(y.sameSite)switch(typeof y.sameSite=="string"?y.sameSite.toLowerCase():y.sameSite){case!0:case"strict":w+="; SameSite=Strict";break;case"lax":w+="; SameSite=Lax";break;case"none":w+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${y.sameSite}`)}return w}function f(p){if(p.indexOf("%")===-1)return p;try{return decodeURIComponent(p)}catch{return p}}function h(p){return i.call(p)==="[object Date]"}return Zu}u$();/**
41
+ * react-router v7.1.1
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */var yC="popstate";function c$(e={}){function t(r,i){let{pathname:o,search:s,hash:a}=r.location;return _0("",{pathname:o,search:s,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ic(i)}return f$(t,n,null,e)}function Ht(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ci(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function d$(){return Math.random().toString(36).substring(2,10)}function vC(e,t){return{usr:e.state,key:e.key,idx:t}}function _0(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Xl(t):t,state:n,key:t&&t.key||r||d$()}}function Ic({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Xl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function f$(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,a="POP",u=null,c=f();c==null&&(c=0,s.replaceState({...s.state,idx:c},""));function f(){return(s.state||{idx:null}).idx}function h(){a="POP";let k=f(),w=k==null?null:k-c;c=k,u&&u({action:a,location:x.location,delta:w})}function p(k,w){a="PUSH";let E=_0(x.location,k,w);c=f()+1;let C=vC(E,c),N=x.createHref(E);try{s.pushState(C,"",N)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(N)}o&&u&&u({action:a,location:x.location,delta:1})}function m(k,w){a="REPLACE";let E=_0(x.location,k,w);c=f();let C=vC(E,c),N=x.createHref(E);s.replaceState(C,"",N),o&&u&&u({action:a,location:x.location,delta:0})}function y(k){let w=i.location.origin!=="null"?i.location.origin:i.location.href,E=typeof k=="string"?k:Ic(k);return E=E.replace(/ $/,"%20"),Ht(w,`No window.location.(origin|href) available to create URL for href: ${E}`),new URL(E,w)}let x={get action(){return a},get location(){return e(i,s)},listen(k){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(yC,h),u=k,()=>{i.removeEventListener(yC,h),u=null}},createHref(k){return t(i,k)},createURL:y,encodeLocation(k){let w=y(k);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:p,replace:m,go(k){return s.go(k)}};return x}function GP(e,t,n="/"){return h$(e,t,n,!1)}function h$(e,t,n,r){let i=typeof t=="string"?Xl(t):t,o=cs(i.pathname||"/",n);if(o==null)return null;let s=ZP(e);p$(s);let a=null;for(let u=0;a==null&&u<s.length;++u){let c=C$(o);a=S$(s[u],c,r)}return a}function ZP(e,t=[],n=[],r=""){let i=(o,s,a)=>{let u={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};u.relativePath.startsWith("/")&&(Ht(u.relativePath.startsWith(r),`Absolute route path "${u.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(r.length));let c=po([r,u.relativePath]),f=n.concat(u);o.children&&o.children.length>0&&(Ht(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),ZP(o.children,t,f,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:b$(c,o.index),routesMeta:f})};return e.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let u of KP(o.path))i(o,s,u)}),t}function KP(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=KP(r.join("/")),a=[];return a.push(...s.map(u=>u===""?o:[o,u].join("/"))),i&&a.push(...s),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function p$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:k$(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var m$=/^:[\w-]+$/,g$=3,y$=2,v$=1,x$=10,w$=-2,xC=e=>e==="*";function b$(e,t){let n=e.split("/"),r=n.length;return n.some(xC)&&(r+=w$),t&&(r+=y$),n.filter(i=>!xC(i)).reduce((i,o)=>i+(m$.test(o)?g$:o===""?v$:x$),r)}function k$(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function S$(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",s=[];for(let a=0;a<r.length;++a){let u=r[a],c=a===r.length-1,f=o==="/"?t:t.slice(o.length)||"/",h=op({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},f),p=u.route;if(!h&&c&&n&&!r[r.length-1].route.index&&(h=op({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},f)),!h)return null;Object.assign(i,h.params),s.push({params:i,pathname:po([o,h.pathname]),pathnameBase:A$(po([o,h.pathnameBase])),route:p}),h.pathnameBase!=="/"&&(o=po([o,h.pathnameBase]))}return s}function op(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=E$(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],s=o.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((c,{paramName:f,isOptional:h},p)=>{if(f==="*"){let y=a[p]||"";s=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const m=a[p];return h&&!m?c[f]=void 0:c[f]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:s,pattern:e}}function E$(e,t=!1,n=!0){ci(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,u)=>(r.push({paramName:a,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function C$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ci(!1,`The URL path "${e}" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function cs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function _$(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Xl(e):e;return{pathname:n?n.startsWith("/")?n:N$(n,t):t,search:P$(r),hash:R$(i)}}function N$(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function nv(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function T$(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ob(e){let t=T$(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function sb(e,t,n,r=!1){let i;typeof e=="string"?i=Xl(e):(i={...e},Ht(!i.pathname||!i.pathname.includes("?"),nv("?","pathname","search",i)),Ht(!i.pathname||!i.pathname.includes("#"),nv("#","pathname","hash",i)),Ht(!i.search||!i.search.includes("#"),nv("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,a;if(s==null)a=n;else{let h=t.length-1;if(!r&&s.startsWith("..")){let p=s.split("/");for(;p[0]==="..";)p.shift(),h-=1;i.pathname=p.join("/")}a=h>=0?t[h]:"/"}let u=_$(i,a),c=s&&s!=="/"&&s.endsWith("/"),f=(o||s===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||f)&&(u.pathname+="/"),u}var po=e=>e.join("/").replace(/\/\/+/g,"/"),A$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),P$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,R$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function M$(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var XP=["POST","PUT","PATCH","DELETE"];new Set(XP);var D$=["GET",...XP];new Set(D$);var Ql=S.createContext(null);Ql.displayName="DataRouter";var em=S.createContext(null);em.displayName="DataRouterState";var QP=S.createContext({isTransitioning:!1});QP.displayName="ViewTransition";var O$=S.createContext(new Map);O$.displayName="Fetchers";var I$=S.createContext(null);I$.displayName="Await";var mi=S.createContext(null);mi.displayName="Navigation";var kd=S.createContext(null);kd.displayName="Location";var Hr=S.createContext({outlet:null,matches:[],isDataRoute:!1});Hr.displayName="Route";var ab=S.createContext(null);ab.displayName="RouteError";function j$(e,{relative:t}={}){Ht(Jl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=S.useContext(mi),{hash:i,pathname:o,search:s}=Sd(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:po([n,o])),r.createHref({pathname:a,search:s,hash:i})}function Jl(){return S.useContext(kd)!=null}function _o(){return Ht(Jl(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(kd).location}var JP="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function eR(e){S.useContext(mi).static||S.useLayoutEffect(e)}function ks(){let{isDataRoute:e}=S.useContext(Hr);return e?X$():L$()}function L$(){Ht(Jl(),"useNavigate() may be used only in the context of a <Router> component.");let e=S.useContext(Ql),{basename:t,navigator:n}=S.useContext(mi),{matches:r}=S.useContext(Hr),{pathname:i}=_o(),o=JSON.stringify(ob(r)),s=S.useRef(!1);return eR(()=>{s.current=!0}),S.useCallback((u,c={})=>{if(ci(s.current,JP),!s.current)return;if(typeof u=="number"){n.go(u);return}let f=sb(u,JSON.parse(o),i,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:po([t,f.pathname])),(c.replace?n.replace:n.push)(f,c.state,c)},[t,n,o,i,e])}var F$=S.createContext(null);function z$(e){let t=S.useContext(Hr).outlet;return t&&S.createElement(F$.Provider,{value:e},t)}function tm(){let{matches:e}=S.useContext(Hr),t=e[e.length-1];return t?t.params:{}}function Sd(e,{relative:t}={}){let{matches:n}=S.useContext(Hr),{pathname:r}=_o(),i=JSON.stringify(ob(n));return S.useMemo(()=>sb(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function $$(e,t){return tR(e,t)}function tR(e,t,n,r){var w;Ht(Jl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=S.useContext(mi),{matches:o}=S.useContext(Hr),s=o[o.length-1],a=s?s.params:{},u=s?s.pathname:"/",c=s?s.pathnameBase:"/",f=s&&s.route;{let E=f&&f.path||"";nR(u,!f||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
+
51
+ Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let h=_o(),p;if(t){let E=typeof t=="string"?Xl(t):t;Ht(c==="/"||((w=E.pathname)==null?void 0:w.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${E.pathname}" was given in the \`location\` prop.`),p=E}else p=h;let m=p.pathname||"/",y=m;if(c!=="/"){let E=c.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(E.length).join("/")}let x=GP(e,{pathname:y});ci(f||x!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),ci(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let k=H$(x&&x.map(E=>Object.assign({},E,{params:Object.assign({},a,E.params),pathname:po([c,i.encodeLocation?i.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?c:po([c,i.encodeLocation?i.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),o,n,r);return t&&k?S.createElement(kd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...p},navigationType:"POP"}},k):k}function B$(){let e=K$(),t=M$(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:o},"ErrorBoundary")," or"," ",S.createElement("code",{style:o},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),n?S.createElement("pre",{style:i},n):null,s)}var V$=S.createElement(B$,null),W$=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?S.createElement(Hr.Provider,{value:this.props.routeContext},S.createElement(ab.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function U$({routeContext:e,match:t,children:n}){let r=S.useContext(Ql);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(Hr.Provider,{value:e},n)}function H$(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,o=n==null?void 0:n.errors;if(o!=null){let u=i.findIndex(c=>c.route.id&&(o==null?void 0:o[c.route.id])!==void 0);Ht(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,u+1))}let s=!1,a=-1;if(n)for(let u=0;u<i.length;u++){let c=i[u];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(a=u),c.route.id){let{loaderData:f,errors:h}=n,p=c.route.loader&&!f.hasOwnProperty(c.route.id)&&(!h||h[c.route.id]===void 0);if(c.route.lazy||p){s=!0,a>=0?i=i.slice(0,a+1):i=[i[0]];break}}}return i.reduceRight((u,c,f)=>{let h,p=!1,m=null,y=null;n&&(h=o&&c.route.id?o[c.route.id]:void 0,m=c.route.errorElement||V$,s&&(a<0&&f===0?(nR("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,y=null):a===f&&(p=!0,y=c.route.hydrateFallbackElement||null)));let x=t.concat(i.slice(0,f+1)),k=()=>{let w;return h?w=m:p?w=y:c.route.Component?w=S.createElement(c.route.Component,null):c.route.element?w=c.route.element:w=u,S.createElement(U$,{match:c,routeContext:{outlet:u,matches:x,isDataRoute:n!=null},children:w})};return n&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?S.createElement(W$,{location:n.location,revalidation:n.revalidation,component:m,error:h,children:k(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):k()},null)}function lb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Y$(e){let t=S.useContext(Ql);return Ht(t,lb(e)),t}function q$(e){let t=S.useContext(em);return Ht(t,lb(e)),t}function G$(e){let t=S.useContext(Hr);return Ht(t,lb(e)),t}function ub(e){let t=G$(e),n=t.matches[t.matches.length-1];return Ht(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Z$(){return ub("useRouteId")}function K$(){var r;let e=S.useContext(ab),t=q$("useRouteError"),n=ub("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function X$(){let{router:e}=Y$("useNavigate"),t=ub("useNavigate"),n=S.useRef(!1);return eR(()=>{n.current=!0}),S.useCallback(async(i,o={})=>{ci(n.current,JP),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var wC={};function nR(e,t,n){!t&&!wC[e]&&(wC[e]=!0,ci(!1,n))}S.memo(Q$);function Q$({routes:e,future:t,state:n}){return tR(e,void 0,n,t)}function J$({to:e,replace:t,state:n,relative:r}){Ht(Jl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=S.useContext(mi);ci(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=S.useContext(Hr),{pathname:s}=_o(),a=ks(),u=sb(e,ob(o),s,r==="path"),c=JSON.stringify(u);return S.useEffect(()=>{a(JSON.parse(c),{replace:t,state:n,relative:r})},[a,c,r,t,n]),null}function eB(e){return z$(e.context)}function ti(e){Ht(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function tB({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1}){Ht(!Jl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),a=S.useMemo(()=>({basename:s,navigator:i,static:o,future:{}}),[s,i,o]);typeof n=="string"&&(n=Xl(n));let{pathname:u="/",search:c="",hash:f="",state:h=null,key:p="default"}=n,m=S.useMemo(()=>{let y=cs(u,s);return y==null?null:{location:{pathname:y,search:c,hash:f,state:h,key:p},navigationType:r}},[s,u,c,f,h,p,r]);return ci(m!=null,`<Router basename="${s}"> is not able to match the URL "${u}${c}${f}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:S.createElement(mi.Provider,{value:a},S.createElement(kd.Provider,{children:t,value:m}))}function nB({children:e,location:t}){return $$(N0(e),t)}function N0(e,t=[]){let n=[];return S.Children.forEach(e,(r,i)=>{if(!S.isValidElement(r))return;let o=[...t,i];if(r.type===S.Fragment){n.push.apply(n,N0(r.props.children,o));return}Ht(r.type===ti,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ht(!r.props.index||!r.props.children,"An index route cannot have child routes.");let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=N0(r.props.children,o)),n.push(s)}),n}var Wh="get",Uh="application/x-www-form-urlencoded";function nm(e){return e!=null&&typeof e.tagName=="string"}function rB(e){return nm(e)&&e.tagName.toLowerCase()==="button"}function iB(e){return nm(e)&&e.tagName.toLowerCase()==="form"}function oB(e){return nm(e)&&e.tagName.toLowerCase()==="input"}function sB(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function aB(e,t){return e.button===0&&(!t||t==="_self")&&!sB(e)}var mh=null;function lB(){if(mh===null)try{new FormData(document.createElement("form"),0),mh=!1}catch{mh=!0}return mh}var uB=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rv(e){return e!=null&&!uB.has(e)?(ci(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Uh}"`),null):e}function cB(e,t){let n,r,i,o,s;if(iB(e)){let a=e.getAttribute("action");r=a?cs(a,t):null,n=e.getAttribute("method")||Wh,i=rv(e.getAttribute("enctype"))||Uh,o=new FormData(e)}else if(rB(e)||oB(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||a.getAttribute("action");if(r=u?cs(u,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||Wh,i=rv(e.getAttribute("formenctype"))||rv(a.getAttribute("enctype"))||Uh,o=new FormData(a,e),!lB()){let{name:c,type:f,value:h}=e;if(f==="image"){let p=c?`${c}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else c&&o.append(c,h)}}else{if(nm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Wh,r=null,i=Uh,s=e}return o&&i==="text/plain"&&(s=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:s}}function cb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function dB(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function fB(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function hB(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let s=await dB(o,n);return s.links?s.links():[]}return[]}));return yB(r.flat(1).filter(fB).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function bC(e,t,n,r,i,o){let s=(u,c)=>n[c]?u.route.id!==n[c].route.id:!0,a=(u,c)=>{var f;return n[c].pathname!==u.pathname||((f=n[c].route.path)==null?void 0:f.endsWith("*"))&&n[c].params["*"]!==u.params["*"]};return o==="assets"?t.filter((u,c)=>s(u,c)||a(u,c)):o==="data"?t.filter((u,c)=>{var h;let f=r.routes[u.route.id];if(!f||!f.hasLoader)return!1;if(s(u,c)||a(u,c))return!0;if(u.route.shouldRevalidate){let p=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((h=n[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function pB(e,t){return mB(e.map(n=>{let r=t.routes[n.route.id];if(!r)return[];let i=[r.module];return r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function mB(e){return[...new Set(e)]}function gB(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function yB(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify(gB(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}function vB(e){let t=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return t.pathname==="/"?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}function xB(){let e=S.useContext(Ql);return cb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function wB(){let e=S.useContext(em);return cb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var db=S.createContext(void 0);db.displayName="FrameworkContext";function rR(){let e=S.useContext(db);return cb(e,"You must render this element inside a <HydratedRouter> element"),e}function bB(e,t){let n=S.useContext(db),[r,i]=S.useState(!1),[o,s]=S.useState(!1),{onFocus:a,onBlur:u,onMouseEnter:c,onMouseLeave:f,onTouchStart:h}=t,p=S.useRef(null);S.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let x=w=>{w.forEach(E=>{s(E.isIntersecting)})},k=new IntersectionObserver(x,{threshold:.5});return p.current&&k.observe(p.current),()=>{k.disconnect()}}},[e]),S.useEffect(()=>{if(r){let x=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(x)}}},[r]);let m=()=>{i(!0)},y=()=>{i(!1),s(!1)};return n?e!=="intent"?[o,p,{}]:[o,p,{onFocus:Ku(a,m),onBlur:Ku(u,y),onMouseEnter:Ku(c,m),onMouseLeave:Ku(f,y),onTouchStart:Ku(h,m)}]:[!1,p,{}]}function Ku(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function kB({page:e,...t}){let{router:n}=xB(),r=S.useMemo(()=>GP(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?S.createElement(EB,{page:e,matches:r,...t}):null}function SB(e){let{manifest:t,routeModules:n}=rR(),[r,i]=S.useState([]);return S.useEffect(()=>{let o=!1;return hB(e,t,n).then(s=>{o||i(s)}),()=>{o=!0}},[e,t,n]),r}function EB({page:e,matches:t,...n}){let r=_o(),{manifest:i,routeModules:o}=rR(),{loaderData:s,matches:a}=wB(),u=S.useMemo(()=>bC(e,t,a,i,r,"data"),[e,t,a,i,r]),c=S.useMemo(()=>bC(e,t,a,i,r,"assets"),[e,t,a,i,r]),f=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let m=new Set,y=!1;if(t.forEach(k=>{var E;let w=i.routes[k.route.id];!w||!w.hasLoader||(!u.some(C=>C.route.id===k.route.id)&&k.route.id in s&&((E=o[k.route.id])!=null&&E.shouldRevalidate)||w.hasClientLoader?y=!0:m.add(k.route.id))}),m.size===0)return[];let x=vB(e);return y&&m.size>0&&x.searchParams.set("_routes",t.filter(k=>m.has(k.route.id)).map(k=>k.route.id).join(",")),[x.pathname+x.search]},[s,r,i,u,t,e,o]),h=S.useMemo(()=>pB(c,i),[c,i]),p=SB(c);return S.createElement(S.Fragment,null,f.map(m=>S.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...n})),h.map(m=>S.createElement("link",{key:m,rel:"modulepreload",href:m,...n})),p.map(({key:m,link:y})=>S.createElement("link",{key:m,...y})))}function CB(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var iR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{iR&&(window.__reactRouterVersion="7.1.1")}catch{}function _B({basename:e,children:t,window:n}){let r=S.useRef();r.current==null&&(r.current=c$({window:n,v5Compat:!0}));let i=r.current,[o,s]=S.useState({action:i.action,location:i.location}),a=S.useCallback(u=>{S.startTransition(()=>s(u))},[s]);return S.useLayoutEffect(()=>i.listen(a),[i,a]),S.createElement(tB,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:i})}var oR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ed=S.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:s,state:a,target:u,to:c,preventScrollReset:f,viewTransition:h,...p},m){let{basename:y}=S.useContext(mi),x=typeof c=="string"&&oR.test(c),k,w=!1;if(typeof c=="string"&&x&&(k=c,iR))try{let j=new URL(window.location.href),R=c.startsWith("//")?new URL(j.protocol+c):new URL(c),$=cs(R.pathname,y);R.origin===j.origin&&$!=null?c=$+R.search+R.hash:w=!0}catch{ci(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let E=j$(c,{relative:i}),[C,N,P]=bB(r,p),A=PB(c,{replace:s,state:a,target:u,preventScrollReset:f,relative:i,viewTransition:h});function O(j){t&&t(j),j.defaultPrevented||A(j)}let M=S.createElement("a",{...p,...P,href:k||E,onClick:w||o?t:O,ref:CB(m,N),target:u,"data-discover":!x&&n==="render"?"true":void 0});return C&&!x?S.createElement(S.Fragment,null,M,S.createElement(kB,{page:E})):M});Ed.displayName="Link";var NB=S.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:s,viewTransition:a,children:u,...c},f){let h=Sd(s,{relative:c.relative}),p=_o(),m=S.useContext(em),{navigator:y,basename:x}=S.useContext(mi),k=m!=null&&IB(h)&&a===!0,w=y.encodeLocation?y.encodeLocation(h).pathname:h.pathname,E=p.pathname,C=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;n||(E=E.toLowerCase(),C=C?C.toLowerCase():null,w=w.toLowerCase()),C&&x&&(C=cs(C,x)||C);const N=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let P=E===w||!i&&E.startsWith(w)&&E.charAt(N)==="/",A=C!=null&&(C===w||!i&&C.startsWith(w)&&C.charAt(w.length)==="/"),O={isActive:P,isPending:A,isTransitioning:k},M=P?t:void 0,j;typeof r=="function"?j=r(O):j=[r,P?"active":null,A?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let R=typeof o=="function"?o(O):o;return S.createElement(Ed,{...c,"aria-current":M,className:j,ref:f,style:R,to:s,viewTransition:a},typeof u=="function"?u(O):u)});NB.displayName="NavLink";var TB=S.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:s=Wh,action:a,onSubmit:u,relative:c,preventScrollReset:f,viewTransition:h,...p},m)=>{let y=DB(),x=OB(a,{relative:c}),k=s.toLowerCase()==="get"?"get":"post",w=typeof a=="string"&&oR.test(a),E=C=>{if(u&&u(C),C.defaultPrevented)return;C.preventDefault();let N=C.nativeEvent.submitter,P=(N==null?void 0:N.getAttribute("formmethod"))||s;y(N||C.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:i,state:o,relative:c,preventScrollReset:f,viewTransition:h})};return S.createElement("form",{ref:m,method:k,action:x,onSubmit:r?u:E,...p,"data-discover":!w&&e==="render"?"true":void 0})});TB.displayName="Form";function AB(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sR(e){let t=S.useContext(Ql);return Ht(t,AB(e)),t}function PB(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:o,viewTransition:s}={}){let a=ks(),u=_o(),c=Sd(e,{relative:o});return S.useCallback(f=>{if(aB(f,t)){f.preventDefault();let h=n!==void 0?n:Ic(u)===Ic(c);a(e,{replace:h,state:r,preventScrollReset:i,relative:o,viewTransition:s})}},[u,a,c,n,r,t,e,i,o,s])}var RB=0,MB=()=>`__${String(++RB)}__`;function DB(){let{router:e}=sR("useSubmit"),{basename:t}=S.useContext(mi),n=Z$();return S.useCallback(async(r,i={})=>{let{action:o,method:s,encType:a,formData:u,body:c}=cB(r,t);if(i.navigate===!1){let f=i.fetcherKey||MB();await e.fetch(f,n,i.action||o,{preventScrollReset:i.preventScrollReset,formData:u,body:c,formMethod:i.method||s,formEncType:i.encType||a,flushSync:i.flushSync})}else await e.navigate(i.action||o,{preventScrollReset:i.preventScrollReset,formData:u,body:c,formMethod:i.method||s,formEncType:i.encType||a,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function OB(e,{relative:t}={}){let{basename:n}=S.useContext(mi),r=S.useContext(Hr);Ht(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...Sd(e||".",{relative:t})},s=_o();if(e==null){o.search=s.search;let a=new URLSearchParams(o.search),u=a.getAll("index");if(u.some(f=>f==="")){a.delete("index"),u.filter(h=>h).forEach(h=>a.append("index",h));let f=a.toString();o.search=f?`?${f}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:po([n,o.pathname])),Ic(o)}function IB(e,t={}){let n=S.useContext(QP);Ht(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=sR("useViewTransitionState"),i=Sd(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=cs(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=cs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return op(i.pathname,s)!=null||op(i.pathname,o)!=null}new TextEncoder;/**
52
+ * @license lucide-react v0.468.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const jB=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),aR=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
57
+ * @license lucide-react v0.468.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */var LB={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
62
+ * @license lucide-react v0.468.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const FB=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},u)=>S.createElement("svg",{ref:u,...LB,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:aR("lucide",i),...a},[...s.map(([c,f])=>S.createElement(c,f)),...Array.isArray(o)?o:[o]]));/**
67
+ * @license lucide-react v0.468.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const Yt=(e,t)=>{const n=S.forwardRef(({className:r,...i},o)=>S.createElement(FB,{ref:o,iconNode:t,className:aR(`lucide-${jB(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
72
+ * @license lucide-react v0.468.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const zB=Yt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
77
+ * @license lucide-react v0.468.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const $B=Yt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
82
+ * @license lucide-react v0.468.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const BB=Yt("BotMessageSquare",[["path",{d:"M12 6V2H8",key:"1155em"}],["path",{d:"m8 18-4 4V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2Z",key:"w2lp3e"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M9 11v2",key:"1ueba0"}],["path",{d:"M15 11v2",key:"i11awn"}],["path",{d:"M20 12h2",key:"1q8mjw"}]]);/**
87
+ * @license lucide-react v0.468.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const lR=Yt("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
92
+ * @license lucide-react v0.468.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const uR=Yt("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
97
+ * @license lucide-react v0.468.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const fb=Yt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
102
+ * @license lucide-react v0.468.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const hb=Yt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
107
+ * @license lucide-react v0.468.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const VB=Yt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
112
+ * @license lucide-react v0.468.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const WB=Yt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
117
+ * @license lucide-react v0.468.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const iv=Yt("Dot",[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]]);/**
122
+ * @license lucide-react v0.468.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const UB=Yt("DraftingCompass",[["path",{d:"m12.99 6.74 1.93 3.44",key:"iwagvd"}],["path",{d:"M19.136 12a10 10 0 0 1-14.271 0",key:"ppmlo4"}],["path",{d:"m21 21-2.16-3.84",key:"vylbct"}],["path",{d:"m3 21 8.02-14.26",key:"1ssaw4"}],["circle",{cx:"12",cy:"5",r:"2",key:"f1ur92"}]]);/**
127
+ * @license lucide-react v0.468.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const HB=Yt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
132
+ * @license lucide-react v0.468.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const YB=Yt("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
137
+ * @license lucide-react v0.468.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const qB=Yt("Footprints",[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]]);/**
142
+ * @license lucide-react v0.468.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const GB=Yt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
147
+ * @license lucide-react v0.468.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const ZB=Yt("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
152
+ * @license lucide-react v0.468.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const cR=Yt("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
157
+ * @license lucide-react v0.468.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const jc=Yt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
162
+ * @license lucide-react v0.468.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const sp=Yt("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/**
167
+ * @license lucide-react v0.468.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const KB=Yt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
172
+ * @license lucide-react v0.468.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const XB=Yt("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
177
+ * @license lucide-react v0.468.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const QB=Yt("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
182
+ * @license lucide-react v0.468.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const T0=Yt("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
187
+ * @license lucide-react v0.468.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const va=Yt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function dR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=dR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function rm(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=dR(e))&&(r&&(r+=" "),r+=t);return r}var eu=qP();const fR=Zl(eu);var JB=e=>{switch(e){case"success":return nV;case"info":return iV;case"warning":return rV;case"error":return oV;default:return null}},eV=Array(12).fill(0),tV=({visible:e,className:t})=>ne.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ne.createElement("div",{className:"sonner-spinner"},eV.map((n,r)=>ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),nV=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),rV=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),iV=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),oV=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),sV=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),aV=()=>{let[e,t]=ne.useState(document.hidden);return ne.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},A0=1,lV=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:A0++,o=this.toasts.find(a=>a.id===i),s=e.dismissible===void 0?!0:e.dismissible;return o?this.toasts=this.toasts.map(a=>a.id===i?(this.publish({...a,...e,id:i,title:n}),{...a,...e,id:i,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,o,s=r.then(async u=>{if(o=["resolve",u],ne.isValidElement(u))i=!1,this.create({id:n,type:"default",message:u});else if(cV(u)&&!u.ok){i=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,f=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description;this.create({id:n,type:"error",message:c,description:f})}else if(t.success!==void 0){i=!1;let c=typeof t.success=="function"?await t.success(u):t.success,f=typeof t.description=="function"?await t.description(u):t.description;this.create({id:n,type:"success",message:c,description:f})}}).catch(async u=>{if(o=["reject",u],t.error!==void 0){i=!1;let c=typeof t.error=="function"?await t.error(u):t.error,f=typeof t.description=="function"?await t.description(u):t.description;this.create({id:n,type:"error",message:c,description:f})}}).finally(()=>{var u;i&&(this.dismiss(n),n=void 0),(u=t.finally)==null||u.call(t)}),a=()=>new Promise((u,c)=>s.then(()=>o[0]==="reject"?c(o[1]):u(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||A0++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},br=new lV,uV=(e,t)=>{let n=(t==null?void 0:t.id)||A0++;return br.addToast({title:e,...t,id:n}),n},cV=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",dV=uV,fV=()=>br.toasts,mn=Object.assign(dV,{success:br.success,info:br.info,warning:br.warning,error:br.error,custom:br.custom,message:br.message,promise:br.promise,dismiss:br.dismiss,loading:br.loading},{getHistory:fV});function hV(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}hV(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
192
+ `);function gh(e){return e.label!==void 0}var pV=3,mV="32px",kC=4e3,gV=356,yV=14,vV=20,xV=200;function wV(...e){return e.filter(Boolean).join(" ")}var bV=e=>{var t,n,r,i,o,s,a,u,c,f,h;let{invert:p,toast:m,unstyled:y,interacting:x,setHeights:k,visibleToasts:w,heights:E,index:C,toasts:N,expanded:P,removeToast:A,defaultRichColors:O,closeButton:M,style:j,cancelButtonStyle:R,actionButtonStyle:$,className:F="",descriptionClassName:H="",duration:I,position:Y,gap:q,loadingIcon:Z,expandByDefault:B,classNames:W,icons:L,closeButtonAriaLabel:U="Close toast",pauseWhenPageIsHidden:V,cn:D}=e,[G,K]=ne.useState(!1),[J,ee]=ne.useState(!1),[re,ue]=ne.useState(!1),[he,be]=ne.useState(!1),[fe,ve]=ne.useState(!1),[Me,$e]=ne.useState(0),[ct,_t]=ne.useState(0),Q=ne.useRef(m.duration||I||kC),oe=ne.useRef(null),ae=ne.useRef(null),Ce=C===0,ke=C+1<=w,ge=m.type,Ae=m.dismissible!==!1,Fe=m.className||"",ce=m.descriptionClassName||"",pe=ne.useMemo(()=>E.findIndex(Ye=>Ye.toastId===m.id)||0,[E,m.id]),Ie=ne.useMemo(()=>{var Ye;return(Ye=m.closeButton)!=null?Ye:M},[m.closeButton,M]);ne.useMemo(()=>m.duration||I||kC,[m.duration,I]);let Ke=ne.useRef(0),tt=ne.useRef(0),At=ne.useRef(0),He=ne.useRef(null),[it,at]=Y.split("-"),Wt=ne.useMemo(()=>E.reduce((Ye,dt,Ct)=>Ct>=pe?Ye:Ye+dt.height,0),[E,pe]),yt=aV(),yn=m.invert||p,gt=ge==="loading";tt.current=ne.useMemo(()=>pe*q+Wt,[pe,Wt]),ne.useEffect(()=>{K(!0)},[]),ne.useEffect(()=>{let Ye=ae.current;if(Ye){let dt=Ye.getBoundingClientRect().height;return _t(dt),k(Ct=>[{toastId:m.id,height:dt,position:m.position},...Ct]),()=>k(Ct=>Ct.filter(rn=>rn.toastId!==m.id))}},[k,m.id]),ne.useLayoutEffect(()=>{if(!G)return;let Ye=ae.current,dt=Ye.style.height;Ye.style.height="auto";let Ct=Ye.getBoundingClientRect().height;Ye.style.height=dt,_t(Ct),k(rn=>rn.find(vn=>vn.toastId===m.id)?rn.map(vn=>vn.toastId===m.id?{...vn,height:Ct}:vn):[{toastId:m.id,height:Ct,position:m.position},...rn])},[G,m.title,m.description,k,m.id]);let jt=ne.useCallback(()=>{ee(!0),$e(tt.current),k(Ye=>Ye.filter(dt=>dt.toastId!==m.id)),setTimeout(()=>{A(m)},xV)},[m,A,k,tt]);ne.useEffect(()=>{if(m.promise&&ge==="loading"||m.duration===1/0||m.type==="loading")return;let Ye;return P||x||V&&yt?(()=>{if(At.current<Ke.current){let dt=new Date().getTime()-Ke.current;Q.current=Q.current-dt}At.current=new Date().getTime()})():Q.current!==1/0&&(Ke.current=new Date().getTime(),Ye=setTimeout(()=>{var dt;(dt=m.onAutoClose)==null||dt.call(m,m),jt()},Q.current)),()=>clearTimeout(Ye)},[P,x,m,ge,V,yt,jt]),ne.useEffect(()=>{m.delete&&jt()},[jt,m.delete]);function ft(){var Ye,dt,Ct;return L!=null&&L.loading?ne.createElement("div",{className:D(W==null?void 0:W.loader,(Ye=m==null?void 0:m.classNames)==null?void 0:Ye.loader,"sonner-loader"),"data-visible":ge==="loading"},L.loading):Z?ne.createElement("div",{className:D(W==null?void 0:W.loader,(dt=m==null?void 0:m.classNames)==null?void 0:dt.loader,"sonner-loader"),"data-visible":ge==="loading"},Z):ne.createElement(tV,{className:D(W==null?void 0:W.loader,(Ct=m==null?void 0:m.classNames)==null?void 0:Ct.loader),visible:ge==="loading"})}return ne.createElement("li",{tabIndex:0,ref:ae,className:D(F,Fe,W==null?void 0:W.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,W==null?void 0:W.default,W==null?void 0:W[ge],(n=m==null?void 0:m.classNames)==null?void 0:n[ge]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:O,"data-styled":!(m.jsx||m.unstyled||y),"data-mounted":G,"data-promise":!!m.promise,"data-swiped":fe,"data-removed":J,"data-visible":ke,"data-y-position":it,"data-x-position":at,"data-index":C,"data-front":Ce,"data-swiping":re,"data-dismissible":Ae,"data-type":ge,"data-invert":yn,"data-swipe-out":he,"data-expanded":!!(P||B&&G),style:{"--index":C,"--toasts-before":C,"--z-index":N.length-C,"--offset":`${J?Me:tt.current}px`,"--initial-height":B?"auto":`${ct}px`,...j,...m.style},onPointerDown:Ye=>{gt||!Ae||(oe.current=new Date,$e(tt.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(ue(!0),He.current={x:Ye.clientX,y:Ye.clientY}))},onPointerUp:()=>{var Ye,dt,Ct,rn;if(he||!Ae)return;He.current=null;let vn=Number(((Ye=ae.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Yi=new Date().getTime()-((dt=oe.current)==null?void 0:dt.getTime()),Sa=Math.abs(vn)/Yi;if(Math.abs(vn)>=vV||Sa>.11){$e(tt.current),(Ct=m.onDismiss)==null||Ct.call(m,m),jt(),be(!0),ve(!1);return}(rn=ae.current)==null||rn.style.setProperty("--swipe-amount","0px"),ue(!1)},onPointerMove:Ye=>{var dt,Ct;if(!He.current||!Ae)return;let rn=Ye.clientY-He.current.y,vn=((dt=window.getSelection())==null?void 0:dt.toString().length)>0,Yi=it==="top"?Math.min(0,rn):Math.max(0,rn);Math.abs(Yi)>0&&ve(!0),!vn&&((Ct=ae.current)==null||Ct.style.setProperty("--swipe-amount",`${Yi}px`))}},Ie&&!m.jsx?ne.createElement("button",{"aria-label":U,"data-disabled":gt,"data-close-button":!0,onClick:gt||!Ae?()=>{}:()=>{var Ye;jt(),(Ye=m.onDismiss)==null||Ye.call(m,m)},className:D(W==null?void 0:W.closeButton,(i=m==null?void 0:m.classNames)==null?void 0:i.closeButton)},(o=L==null?void 0:L.close)!=null?o:sV):null,m.jsx||ne.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:ne.createElement(ne.Fragment,null,ge||m.icon||m.promise?ne.createElement("div",{"data-icon":"",className:D(W==null?void 0:W.icon,(s=m==null?void 0:m.classNames)==null?void 0:s.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||ft():null,m.type!=="loading"?m.icon||(L==null?void 0:L[ge])||JB(ge):null):null,ne.createElement("div",{"data-content":"",className:D(W==null?void 0:W.content,(a=m==null?void 0:m.classNames)==null?void 0:a.content)},ne.createElement("div",{"data-title":"",className:D(W==null?void 0:W.title,(u=m==null?void 0:m.classNames)==null?void 0:u.title)},typeof m.title=="function"?m.title():m.title),m.description?ne.createElement("div",{"data-description":"",className:D(H,ce,W==null?void 0:W.description,(c=m==null?void 0:m.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),ne.isValidElement(m.cancel)?m.cancel:m.cancel&&gh(m.cancel)?ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||R,onClick:Ye=>{var dt,Ct;gh(m.cancel)&&Ae&&((Ct=(dt=m.cancel).onClick)==null||Ct.call(dt,Ye),jt())},className:D(W==null?void 0:W.cancelButton,(f=m==null?void 0:m.classNames)==null?void 0:f.cancelButton)},m.cancel.label):null,ne.isValidElement(m.action)?m.action:m.action&&gh(m.action)?ne.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||$,onClick:Ye=>{var dt,Ct;gh(m.action)&&((Ct=(dt=m.action).onClick)==null||Ct.call(dt,Ye),!Ye.defaultPrevented&&jt())},className:D(W==null?void 0:W.actionButton,(h=m==null?void 0:m.classNames)==null?void 0:h.actionButton)},m.action.label):null))};function SC(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var kV=S.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:s,className:a,offset:u,theme:c="light",richColors:f,duration:h,style:p,visibleToasts:m=pV,toastOptions:y,dir:x=SC(),gap:k=yV,loadingIcon:w,icons:E,containerAriaLabel:C="Notifications",pauseWhenPageIsHidden:N,cn:P=wV}=e,[A,O]=ne.useState([]),M=ne.useMemo(()=>Array.from(new Set([r].concat(A.filter(V=>V.position).map(V=>V.position)))),[A,r]),[j,R]=ne.useState([]),[$,F]=ne.useState(!1),[H,I]=ne.useState(!1),[Y,q]=ne.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=ne.useRef(null),B=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=ne.useRef(null),L=ne.useRef(!1),U=ne.useCallback(V=>{O(D=>{var G;return(G=D.find(K=>K.id===V.id))!=null&&G.delete||br.dismiss(V.id),D.filter(({id:K})=>K!==V.id)})},[]);return ne.useEffect(()=>br.subscribe(V=>{if(V.dismiss){O(D=>D.map(G=>G.id===V.id?{...G,delete:!0}:G));return}setTimeout(()=>{fR.flushSync(()=>{O(D=>{let G=D.findIndex(K=>K.id===V.id);return G!==-1?[...D.slice(0,G),{...D[G],...V},...D.slice(G+1)]:[V,...D]})})})}),[]),ne.useEffect(()=>{if(c!=="system"){q(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:D})=>{q(D?"dark":"light")})}catch{V.addListener(({matches:G})=>{try{q(G?"dark":"light")}catch(K){console.error(K)}})}},[c]),ne.useEffect(()=>{A.length<=1&&F(!1)},[A]),ne.useEffect(()=>{let V=D=>{var G,K;i.every(J=>D[J]||D.code===J)&&(F(!0),(G=Z.current)==null||G.focus()),D.code==="Escape"&&(document.activeElement===Z.current||(K=Z.current)!=null&&K.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[i]),ne.useEffect(()=>{if(Z.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,L.current=!1)}},[Z.current]),ne.createElement("section",{"aria-label":`${C} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},M.map((V,D)=>{var G;let[K,J]=V.split("-");return A.length?ne.createElement("ol",{key:V,dir:x==="auto"?SC():x,tabIndex:-1,ref:Z,className:a,"data-sonner-toaster":!0,"data-theme":Y,"data-y-position":K,"data-lifted":$&&A.length>1&&!o,"data-x-position":J,style:{"--front-toast-height":`${((G=j[0])==null?void 0:G.height)||0}px`,"--offset":typeof u=="number"?`${u}px`:u||mV,"--width":`${gV}px`,"--gap":`${k}px`,...p},onBlur:ee=>{L.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(L.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||L.current||(L.current=!0,W.current=ee.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{H||F(!1)},onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},A.filter(ee=>!ee.position&&D===0||ee.position===V).map((ee,re)=>{var ue,he;return ne.createElement(bV,{key:ee.id,icons:E,index:re,toast:ee,defaultRichColors:f,duration:(ue=y==null?void 0:y.duration)!=null?ue:h,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:n,visibleToasts:m,closeButton:(he=y==null?void 0:y.closeButton)!=null?he:s,interacting:H,position:V,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:U,toasts:A.filter(be=>be.position==ee.position),heights:j.filter(be=>be.position==ee.position),setHeights:R,expandByDefault:o,gap:k,loadingIcon:w,expanded:$,pauseWhenPageIsHidden:N,cn:P})})):null}))});const pb="-",SV=e=>{const t=CV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(pb);return a[0]===""&&a.length!==1&&a.shift(),hR(a,t)||EV(s)},getConflictingClassGroupIds:(s,a)=>{const u=n[s]||[];return a&&r[s]?[...u,...r[s]]:u}}},hR=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?hR(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(pb);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},EC=/^\[(.+)\]$/,EV=e=>{if(EC.test(e)){const t=EC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},CV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return NV(Object.entries(e.classGroups),n).forEach(([o,s])=>{P0(s,r,o,t)}),r},P0=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:CC(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(_V(i)){P0(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{P0(s,CC(t,o),n,r)})})},CC=(e,t)=>{let n=e;return t.split(pb).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},_V=e=>e.isThemeGetter,NV=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[t+s,a])):o);return[n,i]}):e,TV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},pR="!",AV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,s=a=>{const u=[];let c=0,f=0,h;for(let k=0;k<a.length;k++){let w=a[k];if(c===0){if(w===i&&(r||a.slice(k,k+o)===t)){u.push(a.slice(f,k)),f=k+o;continue}if(w==="/"){h=k;continue}}w==="["?c++:w==="]"&&c--}const p=u.length===0?a:a.substring(f),m=p.startsWith(pR),y=m?p.substring(1):p,x=h&&h>f?h-f:void 0;return{modifiers:u,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:x}};return n?a=>n({className:a,parseClassName:s}):s},PV=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},RV=e=>({cache:TV(e.cacheSize),parseClassName:AV(e),...SV(e)}),MV=/\s+/,DV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],s=e.trim().split(MV);let a="";for(let u=s.length-1;u>=0;u-=1){const c=s[u],{modifiers:f,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=n(c);let y=!!m,x=r(y?p.substring(0,m):p);if(!x){if(!y){a=c+(a.length>0?" "+a:a);continue}if(x=r(p),!x){a=c+(a.length>0?" "+a:a);continue}y=!1}const k=PV(f).join(":"),w=h?k+pR:k,E=w+x;if(o.includes(E))continue;o.push(E);const C=i(x,y);for(let N=0;N<C.length;++N){const P=C[N];o.push(w+P)}a=c+(a.length>0?" "+a:a)}return a};function OV(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=mR(t))&&(r&&(r+=" "),r+=n);return r}const mR=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=mR(e[r]))&&(n&&(n+=" "),n+=t);return n};function IV(e,...t){let n,r,i,o=s;function s(u){const c=t.reduce((f,h)=>h(f),e());return n=RV(c),r=n.cache.get,i=n.cache.set,o=a,a(u)}function a(u){const c=r(u);if(c)return c;const f=DV(u,n);return i(u,f),f}return function(){return o(OV.apply(null,arguments))}}const zt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},gR=/^\[(?:([a-z-]+):)?(.+)\]$/i,jV=/^\d+\/\d+$/,LV=new Set(["px","full","screen"]),FV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zV=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$V=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,BV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,VV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,no=e=>vl(e)||LV.has(e)||jV.test(e),Xo=e=>tu(e,"length",KV),vl=e=>!!e&&!Number.isNaN(Number(e)),ov=e=>tu(e,"number",vl),Xu=e=>!!e&&Number.isInteger(Number(e)),WV=e=>e.endsWith("%")&&vl(e.slice(0,-1)),lt=e=>gR.test(e),Qo=e=>FV.test(e),UV=new Set(["length","size","percentage"]),HV=e=>tu(e,UV,yR),YV=e=>tu(e,"position",yR),qV=new Set(["image","url"]),GV=e=>tu(e,qV,QV),ZV=e=>tu(e,"",XV),Qu=()=>!0,tu=(e,t,n)=>{const r=gR.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},KV=e=>zV.test(e)&&!$V.test(e),yR=()=>!1,XV=e=>BV.test(e),QV=e=>VV.test(e),JV=()=>{const e=zt("colors"),t=zt("spacing"),n=zt("blur"),r=zt("brightness"),i=zt("borderColor"),o=zt("borderRadius"),s=zt("borderSpacing"),a=zt("borderWidth"),u=zt("contrast"),c=zt("grayscale"),f=zt("hueRotate"),h=zt("invert"),p=zt("gap"),m=zt("gradientColorStops"),y=zt("gradientColorStopPositions"),x=zt("inset"),k=zt("margin"),w=zt("opacity"),E=zt("padding"),C=zt("saturate"),N=zt("scale"),P=zt("sepia"),A=zt("skew"),O=zt("space"),M=zt("translate"),j=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",lt,t],F=()=>[lt,t],H=()=>["",no,Xo],I=()=>["auto",vl,lt],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["start","end","center","between","around","evenly","stretch"],W=()=>["","0",lt],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[vl,lt];return{cacheSize:500,separator:":",theme:{colors:[Qu],spacing:[no,Xo],blur:["none","",Qo,lt],brightness:U(),borderColor:[e],borderRadius:["none","","full",Qo,lt],borderSpacing:F(),borderWidth:H(),contrast:U(),grayscale:W(),hueRotate:U(),invert:W(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[WV,Xo],inset:$(),margin:$(),opacity:U(),padding:F(),saturate:U(),scale:U(),sepia:W(),skew:U(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",lt]}],container:["container"],columns:[{columns:[Qo]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Y(),lt]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Xu,lt]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",lt]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Xu,lt]}],"grid-cols":[{"grid-cols":[Qu]}],"col-start-end":[{col:["auto",{span:["full",Xu,lt]},lt]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Qu]}],"row-start-end":[{row:["auto",{span:[Xu,lt]},lt]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",lt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",lt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[k]}],mx:[{mx:[k]}],my:[{my:[k]}],ms:[{ms:[k]}],me:[{me:[k]}],mt:[{mt:[k]}],mr:[{mr:[k]}],mb:[{mb:[k]}],ml:[{ml:[k]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",lt,t]}],"min-w":[{"min-w":[lt,t,"min","max","fit"]}],"max-w":[{"max-w":[lt,t,"none","full","min","max","fit","prose",{screen:[Qo]},Qo]}],h:[{h:[lt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[lt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[lt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[lt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Qo,Xo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ov]}],"font-family":[{font:[Qu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",lt]}],"line-clamp":[{"line-clamp":["none",vl,ov]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",no,lt]}],"list-image":[{"list-image":["none",lt]}],"list-style-type":[{list:["none","disc","decimal",lt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",no,Xo]}],"underline-offset":[{"underline-offset":["auto",no,lt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",lt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",lt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),YV]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",HV]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},GV]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...q(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:q()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...q()]}],"outline-offset":[{"outline-offset":[no,lt]}],"outline-w":[{outline:[no,Xo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[no,Xo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qo,ZV]}],"shadow-color":[{shadow:[Qu]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Qo,lt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[h]}],saturate:[{saturate:[C]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",lt]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",lt]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",lt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[Xu,lt]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",lt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",lt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",lt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[no,Xo,ov]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},e6=IV(JV);function Te(...e){return e6(rm(e))}const mb=async(e,t)=>{var r;const n=await fetch(e);if(!n.ok){const i=new Error("An error occurred while fetching the data.");throw i.info=await n.json(),i.status=n.status,t||mn.error(((r=i==null?void 0:i.info)==null?void 0:r.error)||(i==null?void 0:i.message)),i}return n.json()},t6=()=>v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",children:[v.jsx("circle",{cx:"18.0002",cy:"18.0002",r:"15.2365",stroke:"currentColor",strokeWidth:"1.25409"}),v.jsx("ellipse",{cx:"18.0008",cy:"18",rx:"15.2365",ry:"10.2193",transform:"rotate(45 18.0008 18)",stroke:"currentColor",strokeWidth:"1.25409"}),v.jsx("path",{d:"M11.7793 18.0547H24.3007",stroke:"currentColor",strokeWidth:"1.25409"}),v.jsx("path",{d:"M14.8574 21.2354L21.2192 14.8736",stroke:"currentColor",strokeWidth:"1.25409"}),v.jsx("path",{d:"M21.2207 21.2354L14.8589 14.8736",stroke:"currentColor",strokeWidth:"1.25409"}),v.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.57571 11.2943C4.93105 13.0681 3.39081 15.4508 3.39081 17.9997C3.39081 20.5486 4.93105 22.9313 7.57571 24.7051C10.2163 26.4762 13.9001 27.592 18.0003 27.592C22.1004 27.592 25.7842 26.4762 28.4248 24.7051C31.0695 22.9313 32.6097 20.5486 32.6097 17.9997C32.6097 15.4508 31.0695 13.0681 28.4248 11.2943C25.7842 9.5232 22.1004 8.40741 18.0003 8.40741C13.9001 8.40741 10.2163 9.5232 7.57571 11.2943ZM6.87715 10.2528C9.75106 8.32521 13.6855 7.15332 18.0003 7.15332C22.315 7.15332 26.2495 8.32521 29.1234 10.2528C31.9932 12.1776 33.8638 14.9046 33.8638 17.9997C33.8638 21.0948 31.9932 23.8218 29.1234 25.7466C26.2495 27.6742 22.315 28.8461 18.0003 28.8461C13.6855 28.8461 9.75106 27.6742 6.87715 25.7466C4.00728 23.8218 2.13672 21.0948 2.13672 17.9997C2.13672 14.9046 4.00728 12.1776 6.87715 10.2528Z",fill:"currentColor"})]}),n6=[{name:"Agents",url:"/agents",icon:lR},{name:"Tools",url:"/tools",icon:UB},{name:"Workflows",url:"/workflows",icon:T0}],r6=()=>{const{pathname:e}=_o();return v.jsx("div",{className:"relative z-20 h-full text-mastra-el-6",children:v.jsxs("div",{className:"bg-mastra-bg-1 h-full w-full p-4 flex gap-6 flex-col",children:[v.jsx("div",{className:"flex items-center justify-between",children:v.jsxs("div",{className:"flex gap-2 px-2 items-center",children:[v.jsx(t6,{}),v.jsx("p",{className:"text-medium text-sm gradient py-[0.38rem] font-tasa",children:"Mastra Playground"})]})}),v.jsx("div",{children:v.jsx("div",{className:"flex flex-col gap-0.5",children:n6.map(t=>{const[n,r]=e.split("/"),i=t.name.toLowerCase(),o=t.url===e||t.name===e||r===i;return v.jsxs(Ed,{to:t.url,className:Te("flex cursor-pointer w-full px-2 items-center focus-visible:outline-none transition-colors focus-visible:ring-1 focus-visible:ring-mastra-border-4 gap-3 rounded-xs group text-small hover:bg-mastra-el-6/5",o?"bg-mastra-el-6/5":""),children:[v.jsx(t.icon,{className:Te("w-[0.875rem] h-[0.875rem] text-mastra-el-3 group-hover:text-mastra-el-6",o?"text-mastra-el-6":"")}),v.jsx("p",{className:Te("py-[0.38rem] text-mastra-el-6/60 group-hover:text-mastra-el-6 transition-all capitalize ",o?"text-mastra-el-6":""),children:t.name})]})})})}),v.jsxs("div",{className:"flex mt-auto gap-2 items-center justify-center",children:[v.jsx("a",{href:"https://mastra.ai",target:"_blank",rel:"noopener",className:"text-sm text-gray-300/60 hover:text-gray-100",children:"Mastra.AI"}),v.jsx("div",{className:"w-1 h-1 bg-gray-300/60 rounded-full"}),v.jsx("a",{href:"https://mastra.ai/docs/guide",target:"_blank",rel:"noopener",className:"text-sm text-gray-300/60 hover:text-gray-100",children:"Docs"}),v.jsx("div",{className:"w-1 h-1 bg-gray-300/60 rounded-full"}),v.jsx("a",{href:"https://github.com/mastra-ai/mastra",target:"_blank",rel:"noopener",className:"text-sm text-gray-300/60 hover:text-gray-100",children:"GitHub"})]})]})})};var i6=(e,t,n,r,i,o,s,a)=>{let u=document.documentElement,c=["light","dark"];function f(m){(Array.isArray(e)?e:[e]).forEach(y=>{let x=y==="class",k=x&&o?i.map(w=>o[w]||w):i;x?(u.classList.remove(...k),u.classList.add(m)):u.setAttribute(y,m)}),h(m)}function h(m){a&&c.includes(m)&&(u.style.colorScheme=m)}function p(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)f(r);else try{let m=localStorage.getItem(t)||n,y=s&&m==="system"?p():m;f(y)}catch{}},o6=S.createContext(void 0),s6={setTheme:e=>{},themes:[]},a6=()=>{var e;return(e=S.useContext(o6))!=null?e:s6};S.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:o,value:s,themes:a,nonce:u,scriptProps:c})=>{let f=JSON.stringify([n,t,o,e,a,s,r,i]).slice(1,-1);return S.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(${i6.toString()})(${f})`}})});const l6=({...e})=>{const{theme:t="system"}=a6();return v.jsx(kV,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},u6=S.createContext({theme:"system",setTheme:()=>null});function c6({children:e,defaultTheme:t="system"}){const[n,r]=S.useState(t);return S.useEffect(()=>{const i=window.document.documentElement;if(i.classList.remove("light","dark"),n==="system"){const o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";i.classList.add(o);return}i.classList.add(n)},[n]),v.jsx(u6.Provider,{value:{theme:n,setTheme:r},children:e})}const d6=({children:e})=>v.jsxs(c6,{defaultTheme:"dark",attribute:"class",children:[v.jsx(l6,{position:"bottom-right"}),v.jsxs("main",{className:"bg-mastra-bg-1 grid h-full w-full grid-cols-[15rem_minmax(0,_1fr)] overflow-clip",children:[v.jsx("div",{className:"z-20 h-full",children:v.jsx("div",{className:"h-full",children:v.jsx(r6,{})})}),v.jsx("div",{className:"bg-mastra-bg-2 grid h-[calc(100vh-1rem)] relative border-mastra-border-1 rounded-xs border-thin m-2 overflow-hidden border-solid",children:e})]})]}),Er=({title:e,rightElement:t})=>v.jsx("header",{className:"sticky top-0 z-50",children:v.jsx("div",{className:"flex h-[var(--top-bar-height)] w-full content-center items-center justify-between border-b-[0.1px] border-mastra-border-1 px-[1.31rem]",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("h1",{className:"font-medium text-sm font-mono",children:e}),v.jsx("div",{className:"ml-auto",children:t})]})})});function Je({className:e,...t}){return v.jsx("div",{className:Te("animate-pulse rounded-md bg-muted",e),...t})}const vR=()=>{const[e,t]=S.useState({}),[n,r]=S.useState(!0);return S.useEffect(()=>{(async()=>{r(!0);try{const o=await fetch("/api/agents");if(!o.ok){const a=await o.json();t({}),console.error("Error fetching agents",a),mn.error((a==null?void 0:a.error)||"Error fetching agents");return}const s=await o.json();t(s)}catch(o){t({}),console.error("Error fetching agents",o),mn.error("Error fetching agents")}finally{r(!1)}})()},[]),{agents:e,isLoading:n}},im=e=>{const[t,n]=S.useState(null),[r,i]=S.useState(!0);return S.useEffect(()=>{(async()=>{i(!0);try{if(!e){n(null),i(!1);return}const s=await fetch(`/api/agents/${e}`);if(!s.ok){const u=await s.json();n(null),console.error("Error fetching agent",u),mn.error((u==null?void 0:u.error)||"Error fetching agent");return}const a=await s.json();n(a)}catch(s){n(null),console.error("Error fetching agent",s),mn.error("Error fetching agent")}finally{i(!1)}})()},[e]),{agent:t,isLoading:r}},f6=()=>{const[e,t]=S.useState({}),[n,r]=S.useState(!0);return S.useEffect(()=>{(async()=>{r(!0);try{const o=await fetch("/api/tools");if(!o.ok){const a=await o.json();t({}),console.error("Error fetching tools",a),mn.error((a==null?void 0:a.error)||"Error fetching tools");return}const s=await o.json();t(s)}catch(o){t({}),console.error("Error fetching tools",o),mn.error("Error fetching tools")}finally{r(!1)}})()},[]),{tools:e,isLoading:n}},h6=e=>{const[t,n]=S.useState(null),[r,i]=S.useState(!0);return S.useEffect(()=>{(async()=>{i(!0);try{if(!e){n(null),i(!1);return}const s=await fetch(`/api/tools/${e}`);if(!s.ok){const u=await s.json();n(null),console.error("Error fetching tool",u),mn.error((u==null?void 0:u.error)||"Error fetching tool");return}const a=await s.json();n(a)}catch(s){n(null),console.error("Error fetching tool",s),mn.error("Error fetching tool")}finally{i(!1)}})()},[e]),{tool:t,isLoading:r}},p6=()=>{const{agents:e,isLoading:t}=vR(),{tools:n,isLoading:r}=f6(),[i,o]=S.useState(null),[s,a]=S.useState(!0),{agent:u,isLoading:c}=im(i),f=ks();if(t)return v.jsxs("div",{className:"flex flex-col h-full w-full",children:[v.jsx(Er,{title:"Tools"}),v.jsxs("div",{className:"w-full h-full grid grid-cols-[300px_1fr] py-6 px-4",children:[v.jsx("div",{className:"flex flex-col gap-4",children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx("div",{className:"px-2 py-2 rounded-md bg-mastra-bg-13 mb-2",children:v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsx(Je,{className:"h-3 w-3"}),v.jsx(Je,{className:"h-4 w-20"})]})}),v.jsx("div",{className:"flex flex-col gap-2",children:[1,2,3].map(m=>v.jsxs("div",{className:"flex gap-2 items-center px-2 py-2 rounded-md bg-mastra-bg-13",children:[v.jsx(Je,{className:"h-3 w-3"}),v.jsx(Je,{className:"h-4 w-24"})]},m))})]})}),v.jsx("div",{className:"border-l border-mastra-border-1 pl-4",children:v.jsx(Je,{className:"h-full w-full rounded-md"})})]})]});const h=m=>{o(m),a(!1)},p=()=>{a(!0),o(null)};return r||c?v.jsxs("div",{className:"flex flex-col h-full w-full ",children:[v.jsx(Er,{title:"Tools"}),v.jsx("div",{className:"w-full h-full grid grid-cols-[300px_1fr] ",children:v.jsx("div",{className:"w-full h-full border-r-[0.5px] border-mastra-border-1 py-6 px-4",children:v.jsx(Je,{className:"h-full w-full rounded-md"})})})]}):v.jsxs("div",{className:"flex flex-col h-full w-full ",children:[v.jsx(Er,{title:"Tools"}),v.jsxs("div",{className:"w-full h-full grid grid-cols-[300px_1fr] ",children:[v.jsx("div",{className:"w-full h-full border-r-[0.5px] border-mastra-border-1 py-6 px-4",children:v.jsxs("ul",{className:" flex flex-col gap-4",children:[Object.keys(n).length>0&&v.jsx("li",{className:Te("px-2 py-2 rounded-md hover:bg-mastra-bg-4/80 transition-colors cursor-pointer",s&&"bg-mastra-bg-4/80"),onClick:p,children:v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-3",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"})}),v.jsx("p",{className:"text-sm text-mastra-el-6",children:"All Tools"})]})}),Object.entries(e).map(([m,y])=>v.jsx("li",{className:Te("px-2 py-2 rounded-md hover:bg-mastra-bg-4/80 transition-colors cursor-pointer",i===m&&"bg-mastra-bg-4/80"),onClick:()=>h(m),children:v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-3",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"})}),v.jsxs("p",{className:"text-sm text-mastra-el-6",children:[y.name," Tools"]})]})},m))]})}),v.jsx("div",{className:"flex flex-col gap-4 py-6 px-4",children:v.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2",children:c?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[v.jsx(Je,{className:"h-4 w-24"}),v.jsx(Je,{className:"h-4 w-full"})]}),v.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[v.jsx(Je,{className:"h-4 w-24"}),v.jsx(Je,{className:"h-4 w-full"})]}),v.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[v.jsx(Je,{className:"h-4 w-24"}),v.jsx(Je,{className:"h-4 w-full"})]}),v.jsxs("div",{className:"flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] border-[0.5px] border-mastra-border-1",children:[v.jsx(Je,{className:"h-4 w-24"}),v.jsx(Je,{className:"h-4 w-full"})]})]}):s?Object.entries(n).map(([m,y],x)=>v.jsxs("div",{onClick:()=>{f(`/tools/all/${y.id}`)},className:" hover:bg-mastra-bg-4/80 transition-colors flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] cursor-pointer border-[0.5px] border-mastra-border-1",children:[v.jsx("h3",{className:"text-small text-mastra-el-6",children:m}),v.jsx("p",{className:"text-small text-mastra-el-2",children:y.description})]},x)):Object.entries((u==null?void 0:u.tools)??{}).map(([m,y],x)=>v.jsxs("div",{onClick:()=>{f(`/tools/${i}/${y.id}`)},className:" hover:bg-mastra-bg-4/80 transition-colors flex flex-col gap-[0.62rem] bg-mastra-bg-13 px-[0.62rem] py-2 rounded-[0.375rem] cursor-pointer border-[0.5px] border-mastra-border-1",children:[v.jsx("h3",{className:"text-small text-mastra-el-6",children:m}),v.jsx("p",{className:"text-small text-mastra-el-2",children:y.description})]},x))})})]})]})};function _C(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function om(...e){return t=>{let n=!1;const r=e.map(i=>{const o=_C(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():_C(e[i],null)}}}}function pt(...e){return S.useCallback(om(...e),e)}var Li=S.forwardRef((e,t)=>{const{children:n,...r}=e,i=S.Children.toArray(n),o=i.find(m6);if(o){const s=o.props.children,a=i.map(u=>u===o?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:u);return v.jsx(R0,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return v.jsx(R0,{...r,ref:t,children:n})});Li.displayName="Slot";var R0=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const i=y6(n);return S.cloneElement(n,{...g6(r,n.props),ref:t?om(t,i):i})}return S.Children.count(n)>1?S.Children.only(null):null});R0.displayName="SlotClone";var xR=({children:e})=>v.jsx(v.Fragment,{children:e});function m6(e){return S.isValidElement(e)&&e.type===xR}function g6(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function y6(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const NC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,TC=rm,nu=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return TC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const f=n==null?void 0:n[c],h=o==null?void 0:o[c];if(f===null)return null;const p=NC(f)||NC(h);return i[c][p]}),a=n&&Object.entries(n).reduce((c,f)=>{let[h,p]=f;return p===void 0||(c[h]=p),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:h,className:p,...m}=f;return Object.entries(m).every(y=>{let[x,k]=y;return Array.isArray(k)?k.includes({...o,...a}[x]):{...o,...a}[x]===k})?[...c,h,p]:c},[]);return TC(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)},xl=nu("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-mastra-bg-7 border-[0.5px] border-mastra-border-4 text-white hover:bg-mastra-bg-7/70",primary:"border-[0.5px] border-mastra-border-1 bg-mastra-bg-4 hover:bg-mastra-bg-2/80 text-kp-el-6",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Bt=S.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?Li:"button";return v.jsx(s,{className:Te(xl({variant:t,size:n,className:e})),ref:o,...i})});Bt.displayName="Button";var v6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ue=v6.reduce((e,t)=>{const n=S.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?Li:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(a,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function wR(e,t){e&&eu.flushSync(()=>e.dispatchEvent(t))}var Un=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{};function x6(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var nr=e=>{const{present:t,children:n}=e,r=w6(t),i=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),o=pt(r.ref,b6(i));return typeof n=="function"||r.isPresent?S.cloneElement(i,{ref:o}):null};nr.displayName="Presence";function w6(e){const[t,n]=S.useState(),r=S.useRef({}),i=S.useRef(e),o=S.useRef("none"),s=e?"mounted":"unmounted",[a,u]=x6(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=yh(r.current);o.current=a==="mounted"?c:"none"},[a]),Un(()=>{const c=r.current,f=i.current;if(f!==e){const p=o.current,m=yh(c);e?u("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),Un(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,h=m=>{const x=yh(r.current).includes(m.animationName);if(m.target===t&&x&&(u("ANIMATION_END"),!i.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},p=m=>{m.target===t&&(o.current=yh(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function yh(e){return(e==null?void 0:e.animationName)||"none"}function b6(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function k6(e,t){const n=S.createContext(t),r=o=>{const{children:s,...a}=o,u=S.useMemo(()=>a,Object.values(a));return v.jsx(n.Provider,{value:u,children:s})};r.displayName=e+"Provider";function i(o){const s=S.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Yr(e,t=[]){let n=[];function r(o,s){const a=S.createContext(s),u=n.length;n=[...n,s];const c=h=>{var w;const{scope:p,children:m,...y}=h,x=((w=p==null?void 0:p[e])==null?void 0:w[u])||a,k=S.useMemo(()=>y,Object.values(y));return v.jsx(x.Provider,{value:k,children:m})};c.displayName=o+"Provider";function f(h,p){var x;const m=((x=p==null?void 0:p[e])==null?void 0:x[u])||a,y=S.useContext(m);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[c,f]}const i=()=>{const o=n.map(s=>S.createContext(s));return function(a){const u=(a==null?void 0:a[e])||o;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])}};return i.scopeName=e,[r,S6(i,...t)]}function S6(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:u,scopeName:c})=>{const h=u(o)[`__scope${c}`];return{...a,...h}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function fn(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var E6=S.createContext(void 0);function Cd(e){const t=S.useContext(E6);return e||t||"ltr"}function M0(e,[t,n]){return Math.min(n,Math.max(t,e))}function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function C6(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var gb="ScrollArea",[bR,xve]=Yr(gb),[_6,qr]=bR(gb),kR=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,u]=S.useState(null),[c,f]=S.useState(null),[h,p]=S.useState(null),[m,y]=S.useState(null),[x,k]=S.useState(null),[w,E]=S.useState(0),[C,N]=S.useState(0),[P,A]=S.useState(!1),[O,M]=S.useState(!1),j=pt(t,$=>u($)),R=Cd(i);return v.jsx(_6,{scope:n,type:r,dir:R,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:f,content:h,onContentChange:p,scrollbarX:m,onScrollbarXChange:y,scrollbarXEnabled:P,onScrollbarXEnabledChange:A,scrollbarY:x,onScrollbarYChange:k,scrollbarYEnabled:O,onScrollbarYEnabledChange:M,onCornerWidthChange:E,onCornerHeightChange:N,children:v.jsx(Ue.div,{dir:R,...s,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})})});kR.displayName=gb;var SR="ScrollAreaViewport",ER=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=qr(SR,n),a=S.useRef(null),u=pt(t,a,s.onViewportChange);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),v.jsx(Ue.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:v.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});ER.displayName=SR;var Vi="ScrollAreaScrollbar",yb=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=qr(Vi,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return S.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?v.jsx(N6,{...r,ref:t,forceMount:n}):i.type==="scroll"?v.jsx(T6,{...r,ref:t,forceMount:n}):i.type==="auto"?v.jsx(CR,{...r,ref:t,forceMount:n}):i.type==="always"?v.jsx(vb,{...r,ref:t}):null});yb.displayName=Vi;var N6=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=qr(Vi,e.__scopeScrollArea),[o,s]=S.useState(!1);return S.useEffect(()=>{const a=i.scrollArea;let u=0;if(a){const c=()=>{window.clearTimeout(u),s(!0)},f=()=>{u=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",f),()=>{window.clearTimeout(u),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",f)}}},[i.scrollArea,i.scrollHideDelay]),v.jsx(nr,{present:n||o,children:v.jsx(CR,{"data-state":o?"visible":"hidden",...r,ref:t})})}),T6=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=qr(Vi,e.__scopeScrollArea),o=e.orientation==="horizontal",s=am(()=>u("SCROLL_END"),100),[a,u]=C6("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return S.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,i.scrollHideDelay,u]),S.useEffect(()=>{const c=i.viewport,f=o?"scrollLeft":"scrollTop";if(c){let h=c[f];const p=()=>{const m=c[f];h!==m&&(u("SCROLL"),s()),h=m};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[i.viewport,o,u,s]),v.jsx(nr,{present:n||a!=="hidden",children:v.jsx(vb,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Re(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Re(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),CR=S.forwardRef((e,t)=>{const n=qr(Vi,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=S.useState(!1),a=e.orientation==="horizontal",u=am(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:f)}},10);return Tl(n.viewport,u),Tl(n.content,u),v.jsx(nr,{present:r||o,children:v.jsx(vb,{"data-state":o?"visible":"hidden",...i,ref:t})})}),vb=S.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=qr(Vi,e.__scopeScrollArea),o=S.useRef(null),s=S.useRef(0),[a,u]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=PR(a.viewport,a.content),f={...r,sizes:a,onSizesChange:u,hasThumb:c>0&&c<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function h(p,m){return O6(p,s.current,a,m)}return n==="horizontal"?v.jsx(A6,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollLeft,m=AC(p,a,i.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=h(p,i.dir))}}):n==="vertical"?v.jsx(P6,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollTop,m=AC(p,a);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=h(p))}}):null}),A6=S.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=qr(Vi,e.__scopeScrollArea),[s,a]=S.useState(),u=S.useRef(null),c=pt(t,u,o.onScrollbarXChange);return S.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),v.jsx(NR,{"data-orientation":"horizontal",...i,ref:c,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":sm(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(o.viewport){const p=o.viewport.scrollLeft+f.deltaX;e.onWheelScroll(p),MR(p,h)&&f.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:lp(s.paddingLeft),paddingEnd:lp(s.paddingRight)}})}})}),P6=S.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=qr(Vi,e.__scopeScrollArea),[s,a]=S.useState(),u=S.useRef(null),c=pt(t,u,o.onScrollbarYChange);return S.useEffect(()=>{u.current&&a(getComputedStyle(u.current))},[u]),v.jsx(NR,{"data-orientation":"vertical",...i,ref:c,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":sm(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(o.viewport){const p=o.viewport.scrollTop+f.deltaY;e.onWheelScroll(p),MR(p,h)&&f.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:lp(s.paddingTop),paddingEnd:lp(s.paddingBottom)}})}})}),[R6,_R]=bR(Vi),NR=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:u,onDragScroll:c,onWheelScroll:f,onResize:h,...p}=e,m=qr(Vi,n),[y,x]=S.useState(null),k=pt(t,j=>x(j)),w=S.useRef(null),E=S.useRef(""),C=m.viewport,N=r.content-r.viewport,P=fn(f),A=fn(u),O=am(h,10);function M(j){if(w.current){const R=j.clientX-w.current.left,$=j.clientY-w.current.top;c({x:R,y:$})}}return S.useEffect(()=>{const j=R=>{const $=R.target;(y==null?void 0:y.contains($))&&P(R,N)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[C,y,N,P]),S.useEffect(A,[r,A]),Tl(y,O),Tl(m.content,O),v.jsx(R6,{scope:n,scrollbar:y,hasThumb:i,onThumbChange:fn(o),onThumbPointerUp:fn(s),onThumbPositionChange:A,onThumbPointerDown:fn(a),children:v.jsx(Ue.div,{...p,ref:k,style:{position:"absolute",...p.style},onPointerDown:Re(e.onPointerDown,j=>{j.button===0&&(j.target.setPointerCapture(j.pointerId),w.current=y.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),M(j))}),onPointerMove:Re(e.onPointerMove,M),onPointerUp:Re(e.onPointerUp,j=>{const R=j.target;R.hasPointerCapture(j.pointerId)&&R.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=E.current,m.viewport&&(m.viewport.style.scrollBehavior=""),w.current=null})})})}),ap="ScrollAreaThumb",TR=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=_R(ap,e.__scopeScrollArea);return v.jsx(nr,{present:n||i.hasThumb,children:v.jsx(M6,{ref:t,...r})})}),M6=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=qr(ap,n),s=_R(ap,n),{onThumbPositionChange:a}=s,u=pt(t,h=>s.onThumbChange(h)),c=S.useRef(void 0),f=am(()=>{c.current&&(c.current(),c.current=void 0)},100);return S.useEffect(()=>{const h=o.viewport;if(h){const p=()=>{if(f(),!c.current){const m=I6(h,a);c.current=m,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[o.viewport,f,a]),v.jsx(Ue.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Re(e.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),y=h.clientX-m.left,x=h.clientY-m.top;s.onThumbPointerDown({x:y,y:x})}),onPointerUp:Re(e.onPointerUp,s.onThumbPointerUp)})});TR.displayName=ap;var xb="ScrollAreaCorner",AR=S.forwardRef((e,t)=>{const n=qr(xb,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?v.jsx(D6,{...e,ref:t}):null});AR.displayName=xb;var D6=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=qr(xb,n),[o,s]=S.useState(0),[a,u]=S.useState(0),c=!!(o&&a);return Tl(i.scrollbarX,()=>{var h;const f=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(f),u(f)}),Tl(i.scrollbarY,()=>{var h;const f=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(f),s(f)}),c?v.jsx(Ue.div,{...r,ref:t,style:{width:o,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function lp(e){return e?parseInt(e,10):0}function PR(e,t){const n=e/t;return isNaN(n)?0:n}function sm(e){const t=PR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function O6(e,t,n,r="ltr"){const i=sm(n),o=i/2,s=t||o,a=i-s,u=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,f=n.content-n.viewport,h=r==="ltr"?[0,f]:[f*-1,0];return RR([u,c],h)(e)}function AC(e,t,n="ltr"){const r=sm(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,a=o-r,u=n==="ltr"?[0,s]:[s*-1,0],c=M0(e,u);return RR([0,s],[0,a])(c)}function RR(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function MR(e,t){return e>0&&e<t}var I6=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,a=n.top!==o.top;(s||a)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function am(e,t){const n=fn(e),r=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),S.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Tl(e,t){const n=fn(t);Un(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var DR=kR,j6=ER,L6=AR;const fr=S.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(DR,{ref:r,className:Te("relative overflow-hidden",e),...n,children:[v.jsx(j6,{className:"h-full w-full rounded-[inherit]",children:t}),v.jsx(OR,{}),v.jsx(L6,{})]}));fr.displayName=DR.displayName;const OR=S.forwardRef(({className:e,orientation:t="vertical",...n},r)=>v.jsx(yb,{ref:r,orientation:t,className:Te("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:v.jsx(TR,{className:"relative flex-1 rounded-full bg-border"})}));OR.displayName=yb.displayName;const wb=S.forwardRef(({className:e,...t},n)=>v.jsx("table",{ref:n,className:Te("w-full caption-bottom text-sm border-spacing-0",e),...t}));wb.displayName="Table";const bb=S.forwardRef(({className:e,...t},n)=>v.jsx("thead",{ref:n,className:Te("[&_tr]:border-b",e),...t}));bb.displayName="TableHeader";const kb=S.forwardRef(({className:e,...t},n)=>v.jsx("tbody",{ref:n,className:Te("[&_tr:last-child]:border-0",e),...t}));kb.displayName="TableBody";const F6=S.forwardRef(({className:e,...t},n)=>v.jsx("tfoot",{ref:n,className:Te("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));F6.displayName="TableFooter";const ea=S.forwardRef(({className:e,...t},n)=>v.jsx("tr",{ref:n,className:Te("border-b-[0.5px] border-mastra-border-1 transition-colors hover:bg-muted/50 data-[state=selected]:bg-mastra-bg-4/70",e),...t}));ea.displayName="TableRow";const ao=S.forwardRef(({className:e,...t},n)=>v.jsx("th",{ref:n,className:Te("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));ao.displayName="TableHead";const Bn=S.forwardRef(({className:e,...t},n)=>v.jsx("td",{ref:n,className:Te("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Bn.displayName="TableCell";const z6=S.forwardRef(({className:e,...t},n)=>v.jsx("caption",{ref:n,className:Te("mt-4 text-sm text-muted-foreground",e),...t}));z6.displayName="TableCaption";function $6(){const{agents:e,isLoading:t}=vR(),n=ks();return v.jsxs("div",{className:"flex flex-col h-full relative overflow-hidden",children:[v.jsx(Er,{title:"Agents"}),v.jsx("main",{className:"flex-1 relative overflow-hidden",children:v.jsx(fr,{className:"rounded-lg h-full",children:v.jsxs(wb,{children:[v.jsx(bb,{className:"bg-[#171717] sticky top-0 z-10",children:v.jsxs(ea,{className:"border-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[v.jsx(ao,{className:"w-[50px]"}),v.jsx(ao,{className:"text-mastra-el-3",children:"Name"}),v.jsx(ao,{className:"text-mastra-el-3 w-1/2",children:"Instruction"}),v.jsx(ao,{className:"text-mastra-el-3",children:"Model"}),v.jsx(ao,{className:"text-mastra-el-3",children:"Action"})]})}),v.jsx(kb,{className:"border-b border-gray-6",children:t?v.jsxs(ea,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[v.jsx(Bn,{children:v.jsx(Je,{className:"h-8 w-8"})}),v.jsx(Bn,{children:v.jsx(Je,{className:"h-8 w-full"})}),v.jsx(Bn,{children:v.jsx(Je,{className:"h-8 w-full"})}),v.jsx(Bn,{children:v.jsx(Je,{className:"h-8 w-full"})})]}):Object.entries(e).map(([r,i])=>{var o;return v.jsxs(ea,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[v.jsx(Bn,{children:v.jsx("div",{className:"h-8 w-full flex items-center justify-center",children:v.jsx(lR,{className:"h-4 w-4 text-mastra-el-5"})})}),v.jsx(Bn,{className:"font-medium text-mastra-el-5",children:i.name}),v.jsx(Bn,{className:"truncate w-1/2 max-w-[500px] text-mastra-el-5",children:i.instructions}),v.jsx(Bn,{className:"text-mastra-el-5 text-sm",children:(o=i==null?void 0:i.model)==null?void 0:o.provider}),v.jsx(Bn,{className:"text-mastra-el-5 text-sm",children:v.jsx("span",{onClick:()=>{n(`/agents/${r}`)},className:"hover:no-underline",children:v.jsxs(Bt,{size:"sm",variant:"outline",children:[v.jsx(BB,{className:"h-4 w-4 text-inherit"}),"Chat with agent"]})})})]},r)})})]})})})]})}var sv={exports:{}},av={};/**
193
+ * @license React
194
+ * use-sync-external-store-shim.production.js
195
+ *
196
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
197
+ *
198
+ * This source code is licensed under the MIT license found in the
199
+ * LICENSE file in the root directory of this source tree.
200
+ */var PC;function B6(){if(PC)return av;PC=1;var e=Kl();function t(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(h,p){var m=p(),y=r({inst:{value:m,getSnapshot:p}}),x=y[0].inst,k=y[1];return o(function(){x.value=m,x.getSnapshot=p,u(x)&&k({inst:x})},[h,m,p]),i(function(){return u(x)&&k({inst:x}),h(function(){u(x)&&k({inst:x})})},[h]),s(m),m}function u(h){var p=h.getSnapshot;h=h.value;try{var m=p();return!n(h,m)}catch{return!0}}function c(h,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return av.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,av}var RC;function V6(){return RC||(RC=1,sv.exports=B6()),sv.exports}var IR=V6(),MC=Object.prototype.hasOwnProperty;function D0(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&D0(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(MC.call(e,n)&&++r&&!MC.call(t,n)||!(n in t)||!D0(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const lo=new WeakMap,us=()=>{},Jn=us(),O0=Object,Et=e=>e===Jn,Ci=e=>typeof e=="function",ds=(e,t)=>({...e,...t}),jR=e=>Ci(e.then),lv={},vh={},Sb="undefined",lm=typeof window!=Sb,I0=typeof document!=Sb,W6=()=>lm&&typeof window.requestAnimationFrame!=Sb,LR=(e,t)=>{const n=lo.get(e);return[()=>!Et(t)&&e.get(t)||lv,r=>{if(!Et(t)){const i=e.get(t);t in vh||(vh[t]=i),n[5](t,ds(i,r),i||lv)}},n[6],()=>!Et(t)&&t in vh?vh[t]:!Et(t)&&e.get(t)||lv]};let j0=!0;const U6=()=>j0,[L0,F0]=lm&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[us,us],H6=()=>{const e=I0&&document.visibilityState;return Et(e)||e!=="hidden"},Y6=e=>(I0&&document.addEventListener("visibilitychange",e),L0("focus",e),()=>{I0&&document.removeEventListener("visibilitychange",e),F0("focus",e)}),q6=e=>{const t=()=>{j0=!0,e()},n=()=>{j0=!1};return L0("online",t),L0("offline",n),()=>{F0("online",t),F0("offline",n)}},G6={isOnline:U6,isVisible:H6},Z6={initFocus:Y6,initReconnect:q6},DC=!ne.useId,Lc=!lm||"Deno"in globalThis,K6=e=>W6()?window.requestAnimationFrame(e):setTimeout(e,1),uv=Lc?S.useEffect:S.useLayoutEffect,cv=typeof navigator<"u"&&navigator.connection,OC=!Lc&&cv&&(["slow-2g","2g"].includes(cv.effectiveType)||cv.saveData),xh=new WeakMap,dv=(e,t)=>O0.prototype.toString.call(e)===`[object ${t}]`;let X6=0;const z0=e=>{const t=typeof e,n=dv(e,"Date"),r=dv(e,"RegExp"),i=dv(e,"Object");let o,s;if(O0(e)===e&&!n&&!r){if(o=xh.get(e),o)return o;if(o=++X6+"~",xh.set(e,o),Array.isArray(e)){for(o="@",s=0;s<e.length;s++)o+=z0(e[s])+",";xh.set(e,o)}if(i){o="#";const a=O0.keys(e).sort();for(;!Et(s=a.pop());)Et(e[s])||(o+=s+":"+z0(e[s])+",");xh.set(e,o)}}else o=n?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Eb=e=>{if(Ci(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?z0(e):"",[e,t]};let Q6=0;const $0=()=>++Q6,FR=0,zR=1,$R=2,J6=3;var Ju={__proto__:null,ERROR_REVALIDATE_EVENT:J6,FOCUS_EVENT:FR,MUTATE_EVENT:$R,RECONNECT_EVENT:zR};async function BR(...e){const[t,n,r,i]=e,o=ds({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let u=o.optimisticData;const c=p=>typeof a=="function"?a(p):a!==!1,f=o.throwOnError;if(Ci(n)){const p=n,m=[],y=t.keys();for(const x of y)!/^\$(inf|sub)\$/.test(x)&&p(t.get(x)._k)&&m.push(x);return Promise.all(m.map(h))}return h(n);async function h(p){const[m]=Eb(p);if(!m)return;const[y,x]=LR(t,m),[k,w,E,C]=lo.get(t),N=()=>{const H=k[m];return(Ci(o.revalidate)?o.revalidate(y().data,p):o.revalidate!==!1)&&(delete E[m],delete C[m],H&&H[0])?H[0]($R).then(()=>y().data):y().data};if(e.length<3)return N();let P=r,A;const O=$0();w[m]=[O,0];const M=!Et(u),j=y(),R=j.data,$=j._c,F=Et($)?R:$;if(M&&(u=Ci(u)?u(F,R):u,x({data:u,_c:F})),Ci(P))try{P=P(F)}catch(H){A=H}if(P&&jR(P))if(P=await P.catch(H=>{A=H}),O!==w[m][0]){if(A)throw A;return P}else A&&M&&c(A)&&(s=!0,x({data:F,_c:Jn}));if(s&&!A)if(Ci(s)){const H=s(P,F);x({data:H,error:Jn,_c:Jn})}else x({data:P,error:Jn,_c:Jn});if(w[m][1]=$0(),Promise.resolve(N()).then(()=>{x({_c:Jn})}),A){if(f)throw A;return}return P}}const IC=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},e8=(e,t)=>{if(!lo.has(e)){const n=ds(Z6,t),r={},i=BR.bind(Jn,e);let o=us;const s={},a=(f,h)=>{const p=s[f]||[];return s[f]=p,p.push(h),()=>p.splice(p.indexOf(h),1)},u=(f,h,p)=>{e.set(f,h);const m=s[f];if(m)for(const y of m)y(h,p)},c=()=>{if(!lo.has(e)&&(lo.set(e,[r,{},{},{},i,u,a]),!Lc)){const f=n.initFocus(setTimeout.bind(Jn,IC.bind(Jn,r,FR))),h=n.initReconnect(setTimeout.bind(Jn,IC.bind(Jn,r,zR)));o=()=>{f&&f(),h&&h(),lo.delete(e)}}};return c(),[e,i,c,o]}return[e,lo.get(e)[4]]},t8=(e,t,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Et(o)&&s>o||setTimeout(r,a,i)},n8=D0,[VR,r8]=e8(new Map),i8=ds({onLoadingSlow:us,onSuccess:us,onError:us,onErrorRetry:t8,onDiscarded:us,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:OC?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:OC?5e3:3e3,compare:n8,isPaused:()=>!1,cache:VR,mutate:r8,fallback:{}},G6),o8=(e,t)=>{const n=ds(e,t);if(t){const{use:r,fallback:i}=e,{use:o,fallback:s}=t;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=ds(i,s))}return n},s8=S.createContext({}),a8="$inf$",WR=lm&&window.__SWR_DEVTOOLS_USE__,l8=WR?window.__SWR_DEVTOOLS_USE__:[],u8=()=>{WR&&(window.__SWR_DEVTOOLS_REACT__=ne)},c8=e=>Ci(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Cb=()=>ds(i8,S.useContext(s8)),d8=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=Eb(t),[,,,a]=lo.get(VR);if(s.startsWith(a8))return n(...o);const u=a[s];return Et(u)?n(...o):(delete a[s],u)}),r),f8=l8.concat(d8),h8=e=>function(...n){const r=Cb(),[i,o,s]=c8(n),a=o8(r,s);let u=e;const{use:c}=a,f=(c||[]).concat(f8);for(let h=f.length;h--;)u=f[h](u);return u(i,o||a.fetcher||null,a)},p8=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};u8();const fv=ne.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),hv={dedupe:!0},m8=(e,t,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:u,refreshInterval:c,refreshWhenHidden:f,refreshWhenOffline:h,keepPreviousData:p}=n,[m,y,x,k]=lo.get(r),[w,E]=Eb(e),C=S.useRef(!1),N=S.useRef(!1),P=S.useRef(w),A=S.useRef(t),O=S.useRef(n),M=()=>O.current,j=()=>M().isVisible()&&M().isOnline(),[R,$,F,H]=LR(r,w),I=S.useRef({}).current,Y=Et(s)?Et(n.fallback)?Jn:n.fallback[w]:s,q=(fe,ve)=>{for(const Me in I){const $e=Me;if($e==="data"){if(!i(fe[$e],ve[$e])&&(!Et(fe[$e])||!i(K,ve[$e])))return!1}else if(ve[$e]!==fe[$e])return!1}return!0},Z=S.useMemo(()=>{const fe=!w||!t?!1:Et(a)?M().isPaused()||o?!1:u!==!1:a,ve=oe=>{const ae=ds(oe);return delete ae._k,fe?{isValidating:!0,isLoading:!0,...ae}:ae},Me=R(),$e=H(),ct=ve(Me),_t=Me===$e?ct:ve($e);let Q=ct;return[()=>{const oe=ve(R());return q(oe,Q)?(Q.data=oe.data,Q.isLoading=oe.isLoading,Q.isValidating=oe.isValidating,Q.error=oe.error,Q):(Q=oe,oe)},()=>_t]},[r,w]),B=IR.useSyncExternalStore(S.useCallback(fe=>F(w,(ve,Me)=>{q(Me,ve)||fe()}),[r,w]),Z[0],Z[1]),W=!C.current,L=m[w]&&m[w].length>0,U=B.data,V=Et(U)?Y&&jR(Y)?fv(Y):Y:U,D=B.error,G=S.useRef(V),K=p?Et(U)?G.current:U:V,J=L&&!Et(D)?!1:W&&!Et(a)?a:M().isPaused()?!1:o?Et(V)?!1:u:Et(V)||u,ee=!!(w&&t&&W&&J),re=Et(B.isValidating)?ee:B.isValidating,ue=Et(B.isLoading)?ee:B.isLoading,he=S.useCallback(async fe=>{const ve=A.current;if(!w||!ve||N.current||M().isPaused())return!1;let Me,$e,ct=!0;const _t=fe||{},Q=!x[w]||!_t.dedupe,oe=()=>DC?!N.current&&w===P.current&&C.current:w===P.current,ae={isValidating:!1,isLoading:!1},Ce=()=>{$(ae)},ke=()=>{const Ae=x[w];Ae&&Ae[1]===$e&&delete x[w]},ge={isValidating:!0};Et(R().data)&&(ge.isLoading=!0);try{if(Q&&($(ge),n.loadingTimeout&&Et(R().data)&&setTimeout(()=>{ct&&oe()&&M().onLoadingSlow(w,n)},n.loadingTimeout),x[w]=[ve(E),$0()]),[Me,$e]=x[w],Me=await Me,Q&&setTimeout(ke,n.dedupingInterval),!x[w]||x[w][1]!==$e)return Q&&oe()&&M().onDiscarded(w),!1;ae.error=Jn;const Ae=y[w];if(!Et(Ae)&&($e<=Ae[0]||$e<=Ae[1]||Ae[1]===0))return Ce(),Q&&oe()&&M().onDiscarded(w),!1;const Fe=R().data;ae.data=i(Fe,Me)?Fe:Me,Q&&oe()&&M().onSuccess(Me,w,n)}catch(Ae){ke();const Fe=M(),{shouldRetryOnError:ce}=Fe;Fe.isPaused()||(ae.error=Ae,Q&&oe()&&(Fe.onError(Ae,w,Fe),(ce===!0||Ci(ce)&&ce(Ae))&&(!M().revalidateOnFocus||!M().revalidateOnReconnect||j())&&Fe.onErrorRetry(Ae,w,Fe,pe=>{const Ie=m[w];Ie&&Ie[0]&&Ie[0](Ju.ERROR_REVALIDATE_EVENT,pe)},{retryCount:(_t.retryCount||0)+1,dedupe:!0})))}return ct=!1,Ce(),!0},[w,r]),be=S.useCallback((...fe)=>BR(r,P.current,...fe),[]);if(uv(()=>{A.current=t,O.current=n,Et(U)||(G.current=U)}),uv(()=>{if(!w)return;const fe=he.bind(Jn,hv);let ve=0;const $e=p8(w,m,(ct,_t={})=>{if(ct==Ju.FOCUS_EVENT){const Q=Date.now();M().revalidateOnFocus&&Q>ve&&j()&&(ve=Q+M().focusThrottleInterval,fe())}else if(ct==Ju.RECONNECT_EVENT)M().revalidateOnReconnect&&j()&&fe();else{if(ct==Ju.MUTATE_EVENT)return he();if(ct==Ju.ERROR_REVALIDATE_EVENT)return he(_t)}});return N.current=!1,P.current=w,C.current=!0,$({_k:E}),J&&(Et(V)||Lc?fe():K6(fe)),()=>{N.current=!0,$e()}},[w]),uv(()=>{let fe;function ve(){const $e=Ci(c)?c(R().data):c;$e&&fe!==-1&&(fe=setTimeout(Me,$e))}function Me(){!R().error&&(f||M().isVisible())&&(h||M().isOnline())?he(hv).then(ve):ve()}return ve(),()=>{fe&&(clearTimeout(fe),fe=-1)}},[c,f,h,w]),S.useDebugValue(K),o&&Et(V)&&w){if(!DC&&Lc)throw new Error("Fallback data is required when using Suspense in SSR.");A.current=t,O.current=n,N.current=!1;const fe=k[w];if(!Et(fe)){const ve=be(fe);fv(ve)}if(Et(D)){const ve=he(hv);Et(K)||(ve.status="fulfilled",ve.value=!0),fv(ve)}else throw D}return{mutate:be,get data(){return I.data=!0,K},get error(){return I.error=!0,D},get isValidating(){return I.isValidating=!0,re},get isLoading(){return I.isLoading=!0,ue}}},_b=h8(m8);function g8({text:e,copyMessage:t="Copied to clipboard!"}){const[n,r]=S.useState(!1),i=S.useRef(null),o=S.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{mn.success(t),r(!0),i.current&&(clearTimeout(i.current),i.current=null),i.current=setTimeout(()=>{r(!1)},2e3)}).catch(()=>{mn.error("Failed to copy to clipboard.")})},[e,t]);return{isCopied:n,handleCopy:o}}function um({content:e,copyMessage:t,classname:n}){const{isCopied:r,handleCopy:i}=g8({text:e,copyMessage:t});return v.jsxs(Bt,{variant:"ghost",size:"icon",className:Te("relative h-6 w-6",n),"aria-label":"Copy to clipboard",onClick:i,children:[v.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:v.jsx(fb,{className:Te("h-4 w-4 transition-transform ease-in-out",r?"scale-100":"scale-0")})}),v.jsx(WB,{className:Te("h-4 w-4 transition-transform ease-in-out",r?"scale-0":"scale-100")})]})}function y8(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}function cm(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const B0=e=>Array.isArray(e);function UR(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Fc(e){return typeof e=="string"||Array.isArray(e)}function jC(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Nb(e,t,n,r){if(typeof t=="function"){const[i,o]=jC(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=jC(r);t=t(n!==void 0?n:e.custom,i,o)}return t}function dm(e,t,n){const r=e.getProps();return Nb(r,t,n!==void 0?n:r.custom,e)}const Tb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ab=["initial",...Tb],_d=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xa=new Set(_d),mo=e=>e*1e3,go=e=>e/1e3,v8={type:"spring",stiffness:500,damping:25,restSpeed:10},x8=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),w8={type:"keyframes",duration:.8},b8={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},k8=(e,{keyframes:t})=>t.length>2?w8:xa.has(e)?e.startsWith("scale")?x8(t[1]):v8:b8;function Pb(e,t){return e?e[t]||e.default||e:void 0}const S8={skipAnimations:!1,useManualTiming:!1},E8=e=>e!==null;function fm(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(E8),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const Cr=e=>e;let V0=Cr;function C8(e){let t=new Set,n=new Set,r=!1,i=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(c){o.has(c)&&(u.schedule(c),e()),c(s)}const u={schedule:(c,f=!1,h=!1)=>{const m=h&&r?t:n;return f&&o.add(c),m.has(c)||m.add(c),c},cancel:c=>{n.delete(c),o.delete(c)},process:c=>{if(s=c,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(a),t.clear(),r=!1,i&&(i=!1,u.process(c))}};return u}const wh=["read","resolveKeyframes","update","preRender","render","postRender"],_8=40;function HR(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=wh.reduce((w,E)=>(w[E]=C8(o),w),{}),{read:a,resolveKeyframes:u,update:c,preRender:f,render:h,postRender:p}=s,m=()=>{const w=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(w-i.timestamp,_8),1),i.timestamp=w,i.isProcessing=!0,a.process(i),u.process(i),c.process(i),f.process(i),h.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))},y=()=>{n=!0,r=!0,i.isProcessing||e(m)};return{schedule:wh.reduce((w,E)=>{const C=s[E];return w[E]=(N,P=!1,A=!1)=>(n||y(),C.schedule(N,P,A)),w},{}),cancel:w=>{for(let E=0;E<wh.length;E++)s[wh[E]].cancel(w)},state:i,steps:s}}const{schedule:Vt,cancel:fs,state:In,steps:pv}=HR(typeof requestAnimationFrame<"u"?requestAnimationFrame:Cr,!0),YR=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,N8=1e-7,T8=12;function A8(e,t,n,r,i){let o,s,a=0;do s=t+(n-t)/2,o=YR(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>N8&&++a<T8);return s}function Nd(e,t,n,r){if(e===t&&n===r)return Cr;const i=o=>A8(o,0,1,e,n);return o=>o===0||o===1?o:YR(i(o),t,r)}const qR=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,GR=e=>t=>1-e(1-t),ZR=Nd(.33,1.53,.69,.99),Rb=GR(ZR),KR=qR(Rb),XR=e=>(e*=2)<1?.5*Rb(e):.5*(2-Math.pow(2,-10*(e-1))),Mb=e=>1-Math.sin(Math.acos(e)),QR=GR(Mb),JR=qR(Mb),eM=e=>/^0[^.\s]+$/u.test(e);function P8(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||eM(e):!0}const tM=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),nM=e=>t=>typeof t=="string"&&t.startsWith(e),rM=nM("--"),R8=nM("var(--"),Db=e=>R8(e)?M8.test(e.split("/*")[0].trim()):!1,M8=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,D8=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function O8(e){const t=D8.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function iM(e,t,n=1){const[r,i]=O8(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return tM(s)?parseFloat(s):s}return Db(i)?iM(i,t,n+1):i}const xo=(e,t,n)=>n>t?t:n<e?e:n,ru={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},zc={...ru,transform:e=>xo(0,1,e)},bh={...ru,default:1},Td=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),is=Td("deg"),Ri=Td("%"),Qe=Td("px"),I8=Td("vh"),j8=Td("vw"),LC={...Ri,parse:e=>Ri.parse(e)/100,transform:e=>Ri.transform(e*100)},L8=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),FC=e=>e===ru||e===Qe,zC=(e,t)=>parseFloat(e.split(", ")[t]),$C=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return zC(i[1],t);{const o=r.match(/^matrix\((.+)\)$/u);return o?zC(o[1],e):0}},F8=new Set(["x","y","z"]),z8=_d.filter(e=>!F8.has(e));function $8(e){const t=[];return z8.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Al={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:$C(4,13),y:$C(5,14)};Al.translateX=Al.x;Al.translateY=Al.y;const oM=e=>t=>t.test(e),B8={test:e=>e==="auto",parse:e=>e},sM=[ru,Qe,Ri,is,j8,I8,B8],BC=e=>sM.find(oM(e)),ta=new Set;let W0=!1,U0=!1;function aM(){if(U0){const e=Array.from(ta).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=$8(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([o,s])=>{var a;(a=r.getValue(o))===null||a===void 0||a.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}U0=!1,W0=!1,ta.forEach(e=>e.complete()),ta.clear()}function lM(){ta.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(U0=!0)})}function V8(){lM(),aM()}class Ob{constructor(t,n,r,i,o,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ta.add(this),W0||(W0=!0,Vt.read(lM),Vt.resolveKeyframes(aM))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let o=0;o<t.length;o++)if(t[o]===null)if(o===0){const s=i==null?void 0:i.get(),a=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const u=r.readValue(n,a);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=a),i&&s===void 0&&i.set(t[0])}else t[o]=t[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ta.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ta.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const kc=e=>Math.round(e*1e5)/1e5,Ib=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function W8(e){return e==null}const U8=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,jb=(e,t)=>n=>!!(typeof n=="string"&&U8.test(n)&&n.startsWith(e)||t&&!W8(n)&&Object.prototype.hasOwnProperty.call(n,t)),uM=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,o,s,a]=r.match(Ib);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},H8=e=>xo(0,255,e),mv={...ru,transform:e=>Math.round(H8(e))},Xs={test:jb("rgb","red"),parse:uM("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+mv.transform(e)+", "+mv.transform(t)+", "+mv.transform(n)+", "+kc(zc.transform(r))+")"};function Y8(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const H0={test:jb("#"),parse:Y8,transform:Xs.transform},ul={test:jb("hsl","hue"),parse:uM("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ri.transform(kc(t))+", "+Ri.transform(kc(n))+", "+kc(zc.transform(r))+")"},$n={test:e=>Xs.test(e)||H0.test(e)||ul.test(e),parse:e=>Xs.test(e)?Xs.parse(e):ul.test(e)?ul.parse(e):H0.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Xs.transform(e):ul.transform(e)},q8=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function G8(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ib))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(q8))===null||n===void 0?void 0:n.length)||0)>0}const cM="number",dM="color",Z8="var",K8="var(",VC="${}",X8=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function $c(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const a=t.replace(X8,u=>($n.test(u)?(r.color.push(o),i.push(dM),n.push($n.parse(u))):u.startsWith(K8)?(r.var.push(o),i.push(Z8),n.push(u)):(r.number.push(o),i.push(cM),n.push(parseFloat(u))),++o,VC)).split(VC);return{values:n,split:a,indexes:r,types:i}}function fM(e){return $c(e).values}function hM(e){const{split:t,types:n}=$c(e),r=t.length;return i=>{let o="";for(let s=0;s<r;s++)if(o+=t[s],i[s]!==void 0){const a=n[s];a===cM?o+=kc(i[s]):a===dM?o+=$n.transform(i[s]):o+=i[s]}return o}}const Q8=e=>typeof e=="number"?0:e;function J8(e){const t=fM(e);return hM(e)(t.map(Q8))}const hs={test:G8,parse:fM,createTransformer:hM,getAnimatableNone:J8},e9=new Set(["brightness","contrast","saturate","opacity"]);function t9(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Ib)||[];if(!r)return e;const i=n.replace(r,"");let o=e9.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const n9=/\b([a-z-]*)\(.*?\)/gu,Y0={...hs,getAnimatableNone:e=>{const t=e.match(n9);return t?t.map(t9).join(" "):e}},r9={borderWidth:Qe,borderTopWidth:Qe,borderRightWidth:Qe,borderBottomWidth:Qe,borderLeftWidth:Qe,borderRadius:Qe,radius:Qe,borderTopLeftRadius:Qe,borderTopRightRadius:Qe,borderBottomRightRadius:Qe,borderBottomLeftRadius:Qe,width:Qe,maxWidth:Qe,height:Qe,maxHeight:Qe,top:Qe,right:Qe,bottom:Qe,left:Qe,padding:Qe,paddingTop:Qe,paddingRight:Qe,paddingBottom:Qe,paddingLeft:Qe,margin:Qe,marginTop:Qe,marginRight:Qe,marginBottom:Qe,marginLeft:Qe,backgroundPositionX:Qe,backgroundPositionY:Qe},i9={rotate:is,rotateX:is,rotateY:is,rotateZ:is,scale:bh,scaleX:bh,scaleY:bh,scaleZ:bh,skew:is,skewX:is,skewY:is,distance:Qe,translateX:Qe,translateY:Qe,translateZ:Qe,x:Qe,y:Qe,z:Qe,perspective:Qe,transformPerspective:Qe,opacity:zc,originX:LC,originY:LC,originZ:Qe},WC={...ru,transform:Math.round},Lb={...r9,...i9,zIndex:WC,size:Qe,fillOpacity:zc,strokeOpacity:zc,numOctaves:WC},o9={...Lb,color:$n,backgroundColor:$n,outlineColor:$n,fill:$n,stroke:$n,borderColor:$n,borderTopColor:$n,borderRightColor:$n,borderBottomColor:$n,borderLeftColor:$n,filter:Y0,WebkitFilter:Y0},Fb=e=>o9[e];function pM(e,t){let n=Fb(e);return n!==Y0&&(n=hs),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const s9=new Set(["auto","none","0"]);function a9(e,t,n){let r=0,i;for(;r<e.length&&!i;){const o=e[r];typeof o=="string"&&!s9.has(o)&&$c(o).values.length&&(i=e[r]),r++}if(i&&n)for(const o of t)e[o]=pM(n,i)}class mM extends Ob{constructor(t,n,r,i,o){super(t,n,r,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let c=t[u];if(typeof c=="string"&&(c=c.trim(),Db(c))){const f=iM(c,n.current);f!==void 0&&(t[u]=f),u===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!L8.has(r)||t.length!==2)return;const[i,o]=t,s=BC(i),a=BC(o);if(s!==a)if(FC(s)&&FC(a))for(let u=0;u<t.length;u++){const c=t[u];typeof c=="string"&&(t[u]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)P8(t[i])&&r.push(i);r.length&&a9(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Al[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const o=n.getValue(r);o&&o.jump(this.measuredOrigin,!1);const s=i.length-1,a=i[s];i[s]=Al[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([u,c])=>{n.getValue(u).set(c)}),this.resolveNoneKeyframes()}}function zb(e){return typeof e=="function"}let Hh;function l9(){Hh=void 0}const Mi={now:()=>(Hh===void 0&&Mi.set(In.isProcessing||S8.useManualTiming?In.timestamp:performance.now()),Hh),set:e=>{Hh=e,queueMicrotask(l9)}},UC=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hs.test(e)||e==="0")&&!e.startsWith("url("));function u9(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function c9(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],s=UC(i,t),a=UC(o,t);return!s||!a?!1:u9(e)||(n==="spring"||zb(n))&&r}const d9=40;class gM{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Mi.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:o,repeatType:s,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>d9?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&V8(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Mi.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:o,delay:s,onComplete:a,onUpdate:u,isGenerator:c}=this.options;if(!c&&!c9(t,r,i,o))if(s)this.options.duration=0;else{u==null||u(fm(t,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const f=this.initPlayback(t,n);f!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...f},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Pl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},yM=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let o=0;o<i;o++)r+=e(Pl(0,i-1,o))+", ";return`linear(${r.substring(0,r.length-2)})`};function vM(e,t){return t?e*(1e3/t):0}const f9=5;function xM(e,t,n){const r=Math.max(t-f9,0);return vM(n-e(r),t-r)}const tn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},gv=.001;function h9({duration:e=tn.duration,bounce:t=tn.bounce,velocity:n=tn.velocity,mass:r=tn.mass}){let i,o,s=1-t;s=xo(tn.minDamping,tn.maxDamping,s),e=xo(tn.minDuration,tn.maxDuration,go(e)),s<1?(i=c=>{const f=c*s,h=f*e,p=f-n,m=q0(c,s),y=Math.exp(-h);return gv-p/m*y},o=c=>{const h=c*s*e,p=h*n+n,m=Math.pow(s,2)*Math.pow(c,2)*e,y=Math.exp(-h),x=q0(Math.pow(c,2),s);return(-i(c)+gv>0?-1:1)*((p-m)*y)/x}):(i=c=>{const f=Math.exp(-c*e),h=(c-n)*e+1;return-gv+f*h},o=c=>{const f=Math.exp(-c*e),h=(n-c)*(e*e);return f*h});const a=5/e,u=m9(i,o,a);if(e=mo(e),isNaN(u))return{stiffness:tn.stiffness,damping:tn.damping,duration:e};{const c=Math.pow(u,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const p9=12;function m9(e,t,n){let r=n;for(let i=1;i<p9;i++)r=r-e(r)/t(r);return r}function q0(e,t){return e*Math.sqrt(1-t*t)}const G0=2e4;function wM(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<G0;)t+=n,r=e.next(t);return t>=G0?1/0:t}const g9=["duration","bounce"],y9=["stiffness","damping","mass"];function HC(e,t){return t.some(n=>e[n]!==void 0)}function v9(e){let t={velocity:tn.velocity,stiffness:tn.stiffness,damping:tn.damping,mass:tn.mass,isResolvedFromDuration:!1,...e};if(!HC(e,y9)&&HC(e,g9))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,o=2*xo(.05,1,1-e.bounce)*Math.sqrt(i);t={...t,mass:tn.mass,stiffness:i,damping:o}}else{const n=h9(e);t={...t,...n,mass:tn.mass},t.isResolvedFromDuration=!0}return t}function bM(e=tn.visualDuration,t=tn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:u,damping:c,mass:f,duration:h,velocity:p,isResolvedFromDuration:m}=v9({...n,velocity:-go(n.velocity||0)}),y=p||0,x=c/(2*Math.sqrt(u*f)),k=s-o,w=go(Math.sqrt(u/f)),E=Math.abs(k)<5;r||(r=E?tn.restSpeed.granular:tn.restSpeed.default),i||(i=E?tn.restDelta.granular:tn.restDelta.default);let C;if(x<1){const P=q0(w,x);C=A=>{const O=Math.exp(-x*w*A);return s-O*((y+x*w*k)/P*Math.sin(P*A)+k*Math.cos(P*A))}}else if(x===1)C=P=>s-Math.exp(-w*P)*(k+(y+w*k)*P);else{const P=w*Math.sqrt(x*x-1);C=A=>{const O=Math.exp(-x*w*A),M=Math.min(P*A,300);return s-O*((y+x*w*k)*Math.sinh(M)+P*k*Math.cosh(M))/P}}const N={calculatedDuration:m&&h||null,next:P=>{const A=C(P);if(m)a.done=P>=h;else{let O=0;x<1&&(O=P===0?mo(y):xM(C,P,A));const M=Math.abs(O)<=r,j=Math.abs(s-A)<=i;a.done=M&&j}return a.value=a.done?s:A,a},toString:()=>{const P=Math.min(wM(N),G0),A=yM(O=>N.next(P*O).value,P,30);return P+"ms "+A}};return N}function YC({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:u,restDelta:c=.5,restSpeed:f}){const h=e[0],p={done:!1,value:h},m=M=>a!==void 0&&M<a||u!==void 0&&M>u,y=M=>a===void 0?u:u===void 0||Math.abs(a-M)<Math.abs(u-M)?a:u;let x=n*t;const k=h+x,w=s===void 0?k:s(k);w!==k&&(x=w-h);const E=M=>-x*Math.exp(-M/r),C=M=>w+E(M),N=M=>{const j=E(M),R=C(M);p.done=Math.abs(j)<=c,p.value=p.done?w:R};let P,A;const O=M=>{m(p.value)&&(P=M,A=bM({keyframes:[p.value,y(p.value)],velocity:xM(C,M,p.value),damping:i,stiffness:o,restDelta:c,restSpeed:f}))};return O(0),{calculatedDuration:null,next:M=>{let j=!1;return!A&&P===void 0&&(j=!0,N(M),O(M)),P!==void 0&&M>=P?A.next(M-P):(!j&&N(M),p)}}}const x9=Nd(.42,0,1,1),w9=Nd(0,0,.58,1),kM=Nd(.42,0,.58,1),b9=e=>Array.isArray(e)&&typeof e[0]!="number",$b=e=>Array.isArray(e)&&typeof e[0]=="number",qC={linear:Cr,easeIn:x9,easeInOut:kM,easeOut:w9,circIn:Mb,circInOut:JR,circOut:QR,backIn:Rb,backInOut:KR,backOut:ZR,anticipate:XR},GC=e=>{if($b(e)){V0(e.length===4);const[t,n,r,i]=e;return Nd(t,n,r,i)}else if(typeof e=="string")return V0(qC[e]!==void 0),qC[e];return e},k9=(e,t)=>n=>t(e(n)),Ad=(...e)=>e.reduce(k9),Jt=(e,t,n)=>e+(t-e)*n;function yv(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function S9({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,s=0;if(!t)i=o=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,u=2*n-a;i=yv(u,a,e+1/3),o=yv(u,a,e),s=yv(u,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}function up(e,t){return n=>n>0?t:e}const vv=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},E9=[H0,Xs,ul],C9=e=>E9.find(t=>t.test(e));function ZC(e){const t=C9(e);if(!t)return!1;let n=t.parse(e);return t===ul&&(n=S9(n)),n}const KC=(e,t)=>{const n=ZC(e),r=ZC(t);if(!n||!r)return up(e,t);const i={...n};return o=>(i.red=vv(n.red,r.red,o),i.green=vv(n.green,r.green,o),i.blue=vv(n.blue,r.blue,o),i.alpha=Jt(n.alpha,r.alpha,o),Xs.transform(i))},Z0=new Set(["none","hidden"]);function _9(e,t){return Z0.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function N9(e,t){return n=>Jt(e,t,n)}function Bb(e){return typeof e=="number"?N9:typeof e=="string"?Db(e)?up:$n.test(e)?KC:P9:Array.isArray(e)?SM:typeof e=="object"?$n.test(e)?KC:T9:up}function SM(e,t){const n=[...e],r=n.length,i=e.map((o,s)=>Bb(o)(o,t[s]));return o=>{for(let s=0;s<r;s++)n[s]=i[s](o);return n}}function T9(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Bb(e[i])(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}}function A9(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],a=e.indexes[s][i[s]],u=(n=e.values[a])!==null&&n!==void 0?n:0;r[o]=u,i[s]++}return r}const P9=(e,t)=>{const n=hs.createTransformer(t),r=$c(e),i=$c(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Z0.has(e)&&!i.values.length||Z0.has(t)&&!r.values.length?_9(e,t):Ad(SM(A9(r,i),i.values),n):up(e,t)};function EM(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Jt(e,t,n):Bb(e)(e,t)}function R9(e,t,n){const r=[],i=n||EM,o=e.length-1;for(let s=0;s<o;s++){let a=i(e[s],e[s+1]);if(t){const u=Array.isArray(t)?t[s]||Cr:t;a=Ad(u,a)}r.push(a)}return r}function M9(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(V0(o===t.length),o===1)return()=>t[0];if(o===2&&e[0]===e[1])return()=>t[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=R9(t,r,i),a=s.length,u=c=>{let f=0;if(a>1)for(;f<e.length-2&&!(c<e[f+1]);f++);const h=Pl(e[f],e[f+1],c);return s[f](h)};return n?c=>u(xo(e[0],e[o-1],c)):u}function D9(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Pl(0,t,r);e.push(Jt(n,1,i))}}function O9(e){const t=[0];return D9(t,e.length-1),t}function I9(e,t){return e.map(n=>n*t)}function j9(e,t){return e.map(()=>t||kM).splice(0,e.length-1)}function cp({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=b9(r)?r.map(GC):GC(r),o={done:!1,value:t[0]},s=I9(n&&n.length===t.length?n:O9(t),e),a=M9(s,t,{ease:Array.isArray(i)?i:j9(t,i)});return{calculatedDuration:e,next:u=>(o.value=a(u),o.done=u>=e,o)}}const L9=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Vt.update(t,!0),stop:()=>fs(t),now:()=>In.isProcessing?In.timestamp:Mi.now()}},F9={decay:YC,inertia:YC,tween:cp,keyframes:cp,spring:bM},z9=e=>e/100;class Vb extends gM{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:u}=this.options;u&&u()};const{name:n,motionValue:r,element:i,keyframes:o}=this.options,s=(i==null?void 0:i.KeyframeResolver)||Ob,a=(u,c)=>this.onKeyframesResolved(u,c);this.resolver=new s(o,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=this.options,a=zb(n)?n:F9[n]||cp;let u,c;a!==cp&&typeof t[0]!="number"&&(u=Ad(z9,EM(t[0],t[1])),t=[0,100]);const f=a({...this.options,keyframes:t});o==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-s})),f.calculatedDuration===null&&(f.calculatedDuration=wM(f));const{calculatedDuration:h}=f,p=h+i,m=p*(r+1)-i;return{generator:f,mirroredGenerator:c,mapPercentToKeyframes:u,calculatedDuration:h,resolvedDuration:p,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:M}=this.options;return{done:!0,value:M[M.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:s,mapPercentToKeyframes:a,keyframes:u,calculatedDuration:c,totalDuration:f,resolvedDuration:h}=r;if(this.startTime===null)return o.next(0);const{delay:p,repeat:m,repeatType:y,repeatDelay:x,onUpdate:k}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-f/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const w=this.currentTime-p*(this.speed>=0?1:-1),E=this.speed>=0?w<0:w>f;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=f);let C=this.currentTime,N=o;if(m){const M=Math.min(this.currentTime,f)/h;let j=Math.floor(M),R=M%1;!R&&M>=1&&(R=1),R===1&&j--,j=Math.min(j,m+1),!!(j%2)&&(y==="reverse"?(R=1-R,x&&(R-=x/h)):y==="mirror"&&(N=s)),C=xo(0,1,R)*h}const P=E?{done:!1,value:u[0]}:N.next(C);a&&(P.value=a(P.value));let{done:A}=P;!E&&c!==null&&(A=this.speed>=0?this.currentTime>=f:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return O&&i!==void 0&&(P.value=fm(u,this.options,i)),k&&k(P.value),O&&this.finish(),P}get duration(){const{resolved:t}=this;return t?go(t.calculatedDuration):0}get time(){return go(this.currentTime)}set time(t){t=mo(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=go(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=L9,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const $9=new Set(["opacity","clipPath","filter","transform"]);function Wb(e){let t;return()=>(t===void 0&&(t=e()),t)}const B9={linearEasing:void 0};function V9(e,t){const n=Wb(e);return()=>{var r;return(r=B9[t])!==null&&r!==void 0?r:n()}}const dp=V9(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function CM(e){return!!(typeof e=="function"&&dp()||!e||typeof e=="string"&&(e in K0||dp())||$b(e)||Array.isArray(e)&&e.every(CM))}const dc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,K0={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:dc([0,.65,.55,1]),circOut:dc([.55,0,1,.45]),backIn:dc([.31,.01,.66,-.59]),backOut:dc([.33,1.53,.69,.99])};function _M(e,t){if(e)return typeof e=="function"&&dp()?yM(e,t):$b(e)?dc(e):Array.isArray(e)?e.map(n=>_M(n,t)||K0.easeOut):K0[e]}function W9(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:a="easeInOut",times:u}={}){const c={[t]:n};u&&(c.offset=u);const f=_M(a,i);return Array.isArray(f)&&(c.easing=f),e.animate(c,{delay:r,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"})}function XC(e,t){e.timeline=t,e.onfinish=null}const U9=Wb(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),fp=10,H9=2e4;function Y9(e){return zb(e.type)||e.type==="spring"||!CM(e.ease)}function q9(e,t){const n=new Vb({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let o=0;for(;!r.done&&o<H9;)r=n.sample(o),i.push(r.value),o+=fp;return{times:void 0,keyframes:i,duration:o-fp,ease:"linear"}}const NM={anticipate:XR,backInOut:KR,circInOut:JR};function G9(e){return e in NM}class QC extends gM{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:o}=this.options;this.resolver=new mM(o,(s,a)=>this.onKeyframesResolved(s,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){var r;let{duration:i=300,times:o,ease:s,type:a,motionValue:u,name:c,startTime:f}=this.options;if(!(!((r=u.owner)===null||r===void 0)&&r.current))return!1;if(typeof s=="string"&&dp()&&G9(s)&&(s=NM[s]),Y9(this.options)){const{onComplete:p,onUpdate:m,motionValue:y,element:x,...k}=this.options,w=q9(t,k);t=w.keyframes,t.length===1&&(t[1]=t[0]),i=w.duration,o=w.times,s=w.ease,a="keyframes"}const h=W9(u.owner.current,c,t,{...this.options,duration:i,times:o,ease:s});return h.startTime=f??this.calcStartTime(),this.pendingTimeline?(XC(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:p}=this.options;u.set(fm(t,this.options,n)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:i,times:o,type:a,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return go(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return go(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=mo(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Cr;const{animation:r}=n;XC(r,t)}return Cr}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:o,ease:s,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:f,onComplete:h,element:p,...m}=this.options,y=new Vb({...m,keyframes:r,duration:i,type:o,ease:s,times:a,isGenerator:!0}),x=mo(this.time);c.setWithVelocity(y.sample(x-fp).value,y.sample(x).value,fp)}const{onStop:u}=this.options;u&&u(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:o,damping:s,type:a}=t;return U9()&&r&&$9.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&o!=="mirror"&&s!==0&&a!=="inertia"}}const Z9=Wb(()=>window.ScrollTimeline!==void 0);class K9{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,n){return Promise.all(this.animations).then(t).catch(n)}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>Z9()&&i.attachTimeline?i.attachTimeline(t):n(i));return()=>{r.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function X9({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:u,elapsed:c,...f}){return!!Object.keys(f).length}const Ub=(e,t,n,r={},i,o)=>s=>{const a=Pb(r,e)||{},u=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-mo(u);let f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:p=>{t.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};X9(a)||(f={...f,...k8(e,f)}),f.duration&&(f.duration=mo(f.duration)),f.repeatDelay&&(f.repeatDelay=mo(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let h=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(f.duration=0,f.delay===0&&(h=!0)),h&&!o&&t.get()!==void 0){const p=fm(f.keyframes,a);if(p!==void 0)return Vt.update(()=>{f.onUpdate(p),f.onComplete()}),new K9([])}return!o&&QC.supports(f)?new QC(f):new Vb(f)},Q9=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),J9=e=>B0(e)?e[e.length-1]||0:e;function Hb(e,t){e.indexOf(t)===-1&&e.push(t)}function Yb(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class qb{constructor(){this.subscriptions=[]}add(t){return Hb(this.subscriptions,t),()=>Yb(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o<i;o++){const s=this.subscriptions[o];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const JC=30,eW=e=>!isNaN(parseFloat(e));class tW{constructor(t,n={}){this.version="11.15.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const o=Mi.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Mi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=eW(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new qb);const r=this.events[t].add(n);return t==="change"?()=>{r(),Vt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Mi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>JC)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,JC);return vM(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Bc(e,t){return new tW(e,t)}function nW(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Bc(n))}function rW(e,t){const n=dm(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const a=J9(o[s]);nW(e,s,a)}}const Gb=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),iW="framerAppearId",TM="data-"+Gb(iW);function AM(e){return e.props[TM]}const Vn=e=>!!(e&&e.getVelocity);function oW(e){return!!(Vn(e)&&e.add)}function X0(e,t){const n=e.getValue("willChange");if(oW(n))return n.add(t)}function sW({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function PM(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...u}=t;r&&(s=r);const c=[],f=i&&e.animationState&&e.animationState.getState()[i];for(const h in u){const p=e.getValue(h,(o=e.latestValues[h])!==null&&o!==void 0?o:null),m=u[h];if(m===void 0||f&&sW(f,h))continue;const y={delay:n,...Pb(s||{},h)};let x=!1;if(window.MotionHandoffAnimation){const w=AM(e);if(w){const E=window.MotionHandoffAnimation(w,h,Vt);E!==null&&(y.startTime=E,x=!0)}}X0(e,h),p.start(Ub(h,p,m,e.shouldReduceMotion&&xa.has(h)?{type:!1}:y,e,x));const k=p.animation;k&&c.push(k)}return a&&Promise.all(c).then(()=>{Vt.update(()=>{a&&rW(e,a)})}),c}function Q0(e,t,n={}){var r;const i=dm(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(PM(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:f=0,staggerChildren:h,staggerDirection:p}=o;return aW(e,t,f+c,h,p,n)}:()=>Promise.resolve(),{when:u}=o;if(u){const[c,f]=u==="beforeChildren"?[s,a]:[a,s];return c().then(()=>f())}else return Promise.all([s(),a(n.delay)])}function aW(e,t,n=0,r=0,i=1,o){const s=[],a=(e.variantChildren.size-1)*r,u=i===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(lW).forEach((c,f)=>{c.notify("AnimationStart",t),s.push(Q0(c,t,{...o,delay:n+u(f)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(s)}function lW(e,t){return e.sortNodePosition(t)}function uW(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>Q0(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=Q0(e,t,n);else{const i=typeof t=="function"?dm(e,t,n.custom):t;r=Promise.all(PM(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const cW=Ab.length;function RM(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?RM(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<cW;n++){const r=Ab[n],i=e.props[r];(Fc(i)||i===!1)&&(t[r]=i)}return t}const dW=[...Tb].reverse(),fW=Tb.length;function hW(e){return t=>Promise.all(t.map(({animation:n,options:r})=>uW(e,n,r)))}function pW(e){let t=hW(e),n=e_(),r=!0;const i=u=>(c,f)=>{var h;const p=dm(e,f,u==="exit"?(h=e.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(p){const{transition:m,transitionEnd:y,...x}=p;c={...c,...x,...y}}return c};function o(u){t=u(e)}function s(u){const{props:c}=e,f=RM(e.parent)||{},h=[],p=new Set;let m={},y=1/0;for(let k=0;k<fW;k++){const w=dW[k],E=n[w],C=c[w]!==void 0?c[w]:f[w],N=Fc(C),P=w===u?E.isActive:null;P===!1&&(y=k);let A=C===f[w]&&C!==c[w]&&N;if(A&&r&&e.manuallyAnimateOnMount&&(A=!1),E.protectedKeys={...m},!E.isActive&&P===null||!C&&!E.prevProp||cm(C)||typeof C=="boolean")continue;const O=mW(E.prevProp,C);let M=O||w===u&&E.isActive&&!A&&N||k>y&&N,j=!1;const R=Array.isArray(C)?C:[C];let $=R.reduce(i(w),{});P===!1&&($={});const{prevResolvedValues:F={}}=E,H={...F,...$},I=Z=>{M=!0,p.has(Z)&&(j=!0,p.delete(Z)),E.needsAnimating[Z]=!0;const B=e.getValue(Z);B&&(B.liveStyle=!1)};for(const Z in H){const B=$[Z],W=F[Z];if(m.hasOwnProperty(Z))continue;let L=!1;B0(B)&&B0(W)?L=!UR(B,W):L=B!==W,L?B!=null?I(Z):p.add(Z):B!==void 0&&p.has(Z)?I(Z):E.protectedKeys[Z]=!0}E.prevProp=C,E.prevResolvedValues=$,E.isActive&&(m={...m,...$}),r&&e.blockInitialAnimation&&(M=!1),M&&(!(A&&O)||j)&&h.push(...R.map(Z=>({animation:Z,options:{type:w}})))}if(p.size){const k={};p.forEach(w=>{const E=e.getBaseTarget(w),C=e.getValue(w);C&&(C.liveStyle=!0),k[w]=E??null}),h.push({animation:k})}let x=!!h.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,x?t(h):Promise.resolve()}function a(u,c){var f;if(n[u].isActive===c)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(p=>{var m;return(m=p.animationState)===null||m===void 0?void 0:m.setActive(u,c)}),n[u].isActive=c;const h=s(u);for(const p in n)n[p].protectedKeys={};return h}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=e_(),r=!0}}}function mW(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!UR(t,e):!1}function Us(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function e_(){return{animate:Us(!0),whileInView:Us(),whileHover:Us(),whileTap:Us(),whileDrag:Us(),whileFocus:Us(),exit:Us()}}class Ss{constructor(t){this.isMounted=!1,this.node=t}update(){}}class gW extends Ss{constructor(t){super(t),t.animationState||(t.animationState=pW(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();cm(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let yW=0;class vW extends Ss{constructor(){super(...arguments),this.id=yW++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const xW={animation:{Feature:gW},exit:{Feature:vW}},ni={x:!1,y:!1};function MM(){return ni.x||ni.y}function wW(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const o=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function DM(e,t){const n=wW(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function t_(e){return t=>{t.pointerType==="touch"||MM()||e(t)}}function bW(e,t,n={}){const[r,i,o]=DM(e,n),s=t_(a=>{const{target:u}=a,c=t(a);if(!c||!u)return;const f=t_(h=>{c(h),u.removeEventListener("pointerleave",f)});u.addEventListener("pointerleave",f,i)});return r.forEach(a=>{a.addEventListener("pointerenter",s,i)}),o}const Zb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,fc=new WeakSet;function n_(e){return t=>{t.key==="Enter"&&e(t)}}function xv(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const kW=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=n_(()=>{if(fc.has(n))return;xv(n,"down");const i=n_(()=>{xv(n,"up")}),o=()=>xv(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)},SW=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function EW(e){return SW.has(e.tagName)||e.tabIndex!==-1}const OM=(e,t)=>t?e===t?!0:OM(e,t.parentElement):!1;function r_(e){return Zb(e)&&!MM()}function CW(e,t,n={}){const[r,i,o]=DM(e,n),s=a=>{const u=a.currentTarget;if(!r_(a)||fc.has(u))return;fc.add(u);const c=t(a),f=(m,y)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",p),!(!r_(m)||!fc.has(u))&&(fc.delete(u),c&&c(m,{success:y}))},h=m=>{f(m,n.useGlobalTarget||OM(u,m.target))},p=m=>{f(m,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",p,i)};return r.forEach(a=>{EW(a)||(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,i),a.addEventListener("focus",c=>kW(c,i),i)}),o}function _W(e){return e==="x"||e==="y"?ni[e]?null:(ni[e]=!0,()=>{ni[e]=!1}):ni.x||ni.y?null:(ni.x=ni.y=!0,()=>{ni.x=ni.y=!1})}function Pd(e){return{point:{x:e.pageX,y:e.pageY}}}const NW=e=>t=>Zb(t)&&e(t,Pd(t));function Vc(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Sc(e,t,n,r){return Vc(e,t,NW(n),r)}const i_=(e,t)=>Math.abs(e-t);function TW(e,t){const n=i_(e.x,t.x),r=i_(e.y,t.y);return Math.sqrt(n**2+r**2)}class IM{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=bv(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=TW(h.offset,{x:0,y:0})>=3;if(!p&&!m)return;const{point:y}=h,{timestamp:x}=In;this.history.push({...y,timestamp:x});const{onStart:k,onMove:w}=this.handlers;p||(k&&k(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,h)},this.handlePointerMove=(h,p)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=wv(p,this.transformPagePoint),Vt.update(this.updatePoint,!0)},this.handlePointerUp=(h,p)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=bv(h.type==="pointercancel"?this.lastMoveEventInfo:wv(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(h,k),y&&y(h,k)},!Zb(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const s=Pd(t),a=wv(s,this.transformPagePoint),{point:u}=a,{timestamp:c}=In;this.history=[{...u,timestamp:c}];const{onSessionStart:f}=n;f&&f(t,bv(a,this.history)),this.removeListeners=Ad(Sc(this.contextWindow,"pointermove",this.handlePointerMove),Sc(this.contextWindow,"pointerup",this.handlePointerUp),Sc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),fs(this.updatePoint)}}function wv(e,t){return t?{point:t(e.point)}:e}function o_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function bv({point:e},t){return{point:e,delta:o_(e,jM(t)),offset:o_(e,AW(t)),velocity:PW(t,.1)}}function AW(e){return e[0]}function jM(e){return e[e.length-1]}function PW(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=jM(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>mo(t)));)n--;if(!r)return{x:0,y:0};const o=go(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function cl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const LM=1e-4,RW=1-LM,MW=1+LM,FM=.01,DW=0-FM,OW=0+FM;function Pr(e){return e.max-e.min}function IW(e,t,n){return Math.abs(e-t)<=n}function s_(e,t,n,r=.5){e.origin=r,e.originPoint=Jt(t.min,t.max,e.origin),e.scale=Pr(n)/Pr(t),e.translate=Jt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=RW&&e.scale<=MW||isNaN(e.scale))&&(e.scale=1),(e.translate>=DW&&e.translate<=OW||isNaN(e.translate))&&(e.translate=0)}function Ec(e,t,n,r){s_(e.x,t.x,n.x,r?r.originX:void 0),s_(e.y,t.y,n.y,r?r.originY:void 0)}function a_(e,t,n){e.min=n.min+t.min,e.max=e.min+Pr(t)}function jW(e,t,n){a_(e.x,t.x,n.x),a_(e.y,t.y,n.y)}function l_(e,t,n){e.min=t.min-n.min,e.max=e.min+Pr(t)}function Cc(e,t,n){l_(e.x,t.x,n.x),l_(e.y,t.y,n.y)}function LW(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Jt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Jt(n,e,r.max):Math.min(e,n)),e}function u_(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function FW(e,{top:t,left:n,bottom:r,right:i}){return{x:u_(e.x,n,i),y:u_(e.y,t,r)}}function c_(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function zW(e,t){return{x:c_(e.x,t.x),y:c_(e.y,t.y)}}function $W(e,t){let n=.5;const r=Pr(e),i=Pr(t);return i>r?n=Pl(t.min,t.max-r,e.min):r>i&&(n=Pl(e.min,e.max-i,t.min)),xo(0,1,n)}function BW(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const J0=.35;function VW(e=J0){return e===!1?e=0:e===!0&&(e=J0),{x:d_(e,"left","right"),y:d_(e,"top","bottom")}}function d_(e,t,n){return{min:f_(e,t),max:f_(e,n)}}function f_(e,t){return typeof e=="number"?e:e[t]||0}const h_=()=>({translate:0,scale:1,origin:0,originPoint:0}),dl=()=>({x:h_(),y:h_()}),p_=()=>({min:0,max:0}),sn=()=>({x:p_(),y:p_()});function $r(e){return[e("x"),e("y")]}function zM({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function WW({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function UW(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function kv(e){return e===void 0||e===1}function ew({scale:e,scaleX:t,scaleY:n}){return!kv(e)||!kv(t)||!kv(n)}function Ys(e){return ew(e)||$M(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function $M(e){return m_(e.x)||m_(e.y)}function m_(e){return e&&e!=="0%"}function hp(e,t,n){const r=e-n,i=t*r;return n+i}function g_(e,t,n,r,i){return i!==void 0&&(e=hp(e,i,r)),hp(e,n,r)+t}function tw(e,t=0,n=1,r,i){e.min=g_(e.min,t,n,r,i),e.max=g_(e.max,t,n,r,i)}function BM(e,{x:t,y:n}){tw(e.x,t.translate,t.scale,t.originPoint),tw(e.y,n.translate,n.scale,n.originPoint)}const y_=.999999999999,v_=1.0000000000001;function HW(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const{visualElement:u}=o.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&hl(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,BM(e,s)),r&&Ys(o.latestValues)&&hl(e,o.latestValues))}t.x<v_&&t.x>y_&&(t.x=1),t.y<v_&&t.y>y_&&(t.y=1)}function fl(e,t){e.min=e.min+t,e.max=e.max+t}function x_(e,t,n,r,i=.5){const o=Jt(e.min,e.max,i);tw(e,t,n,o,r)}function hl(e,t){x_(e.x,t.x,t.scaleX,t.scale,t.originX),x_(e.y,t.y,t.scaleY,t.scale,t.originY)}function VM(e,t){return zM(UW(e.getBoundingClientRect(),t))}function YW(e,t,n){const r=VM(e,n),{scroll:i}=t;return i&&(fl(r.x,i.offset.x),fl(r.y,i.offset.y)),r}const WM=({current:e})=>e?e.ownerDocument.defaultView:null,qW=new WeakMap;class GW{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=sn(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Pd(f).point)},o=(f,h)=>{const{drag:p,dragPropagation:m,onDragStart:y}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=_W(p),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$r(k=>{let w=this.getAxisMotionValue(k).get()||0;if(Ri.test(w)){const{projection:E}=this.visualElement;if(E&&E.layout){const C=E.layout.layoutBox[k];C&&(w=Pr(C)*(parseFloat(w)/100))}}this.originPoint[k]=w}),y&&Vt.postRender(()=>y(f,h)),X0(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},s=(f,h)=>{const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:y,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:k}=h;if(m&&this.currentDirection===null){this.currentDirection=ZW(k),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",h.point,k),this.updateAxis("y",h.point,k),this.visualElement.render(),x&&x(f,h)},a=(f,h)=>this.stop(f,h),u=()=>$r(f=>{var h;return this.getAnimationState(f)==="paused"&&((h=this.getAxisMotionValue(f).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new IM(t,{onSessionStart:i,onStart:o,onMove:s,onSessionEnd:a,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:WM(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&Vt.postRender(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!kh(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=LW(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,o=this.constraints;n&&cl(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=FW(i.layoutBox,n):this.constraints=!1,this.elastic=VW(r),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&$r(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=BW(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!cl(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=YW(r,i.root,this.visualElement.getTransformPagePoint());let s=zW(i.layout.layoutBox,o);if(n){const a=n(WW(s));this.hasMutatedConstraints=!!a,a&&(s=zM(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),u=this.constraints||{},c=$r(f=>{if(!kh(f,n,this.currentDirection))return;let h=u[f]||{};s&&(h={min:0,max:0});const p=i?200:1e6,m=i?40:1e7,y={type:"inertia",velocity:r?t[f]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(f,y)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return X0(this.visualElement,t),r.start(Ub(t,r,0,n,this.visualElement,!1))}stopAnimation(){$r(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){$r(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){$r(n=>{const{drag:r}=this.getProps();if(!kh(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[n];o.set(t[n]-Jt(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!cl(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};$r(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const u=a.get();i[s]=$W({min:u,max:u},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),$r(s=>{if(!kh(s,t,null))return;const a=this.getAxisMotionValue(s),{min:u,max:c}=this.constraints[s];a.set(Jt(u,c,i[s]))})}addListeners(){if(!this.visualElement.current)return;qW.set(this.visualElement,this);const t=this.visualElement.current,n=Sc(t,"pointerdown",u=>{const{drag:c,dragListener:f=!0}=this.getProps();c&&f&&this.start(u)}),r=()=>{const{dragConstraints:u}=this.getProps();cl(u)&&u.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Vt.read(r);const s=Vc(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&($r(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=u[f].translate,h.set(h.get()+u[f].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=J0,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function kh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ZW(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class KW extends Ss{constructor(t){super(t),this.removeGroupControls=Cr,this.removeListeners=Cr,this.controls=new GW(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Cr}unmount(){this.removeGroupControls(),this.removeListeners()}}const w_=e=>(t,n)=>{e&&Vt.postRender(()=>e(t,n))};class XW extends Ss{constructor(){super(...arguments),this.removePointerDownListener=Cr}onPointerDown(t){this.session=new IM(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:WM(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:w_(t),onStart:w_(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&Vt.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=Sc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const hm=S.createContext(null);function QW(){const e=S.useContext(hm);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=S.useId();S.useEffect(()=>r(i),[]);const o=S.useCallback(()=>n&&n(i),[i,n]);return!t&&n?[!1,o]:[!0]}const Kb=S.createContext({}),UM=S.createContext({}),Yh={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function b_(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ec={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Qe.test(e))e=parseFloat(e);else return e;const n=b_(e,t.target.x),r=b_(e,t.target.y);return`${n}% ${r}%`}},JW={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=hs.parse(e);if(i.length>5)return r;const o=hs.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,u=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=u;const c=Jt(a,u,.5);return typeof i[2+s]=="number"&&(i[2+s]/=c),typeof i[3+s]=="number"&&(i[3+s]/=c),o(i)}},pp={};function eU(e){Object.assign(pp,e)}const{schedule:Xb,cancel:wve}=HR(queueMicrotask,!1);class tU extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;eU(nU),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Yh.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,s=r.projection;return s&&(s.isPresent=o,i||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Vt.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Xb.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function HM(e){const[t,n]=QW(),r=S.useContext(Kb);return v.jsx(tU,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(UM),isPresent:t,safeToRemove:n})}const nU={borderRadius:{...ec,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ec,borderTopRightRadius:ec,borderBottomLeftRadius:ec,borderBottomRightRadius:ec,boxShadow:JW},YM=["TopLeft","TopRight","BottomLeft","BottomRight"],rU=YM.length,k_=e=>typeof e=="string"?parseFloat(e):e,S_=e=>typeof e=="number"||Qe.test(e);function iU(e,t,n,r,i,o){i?(e.opacity=Jt(0,n.opacity!==void 0?n.opacity:1,oU(r)),e.opacityExit=Jt(t.opacity!==void 0?t.opacity:1,0,sU(r))):o&&(e.opacity=Jt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;s<rU;s++){const a=`border${YM[s]}Radius`;let u=E_(t,a),c=E_(n,a);if(u===void 0&&c===void 0)continue;u||(u=0),c||(c=0),u===0||c===0||S_(u)===S_(c)?(e[a]=Math.max(Jt(k_(u),k_(c),r),0),(Ri.test(c)||Ri.test(u))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Jt(t.rotate||0,n.rotate||0,r))}function E_(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const oU=qM(0,.5,QR),sU=qM(.5,.95,Cr);function qM(e,t,n){return r=>r<e?0:r>t?1:n(Pl(e,t,r))}function C_(e,t){e.min=t.min,e.max=t.max}function zr(e,t){C_(e.x,t.x),C_(e.y,t.y)}function __(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function N_(e,t,n,r,i){return e-=t,e=hp(e,1/n,r),i!==void 0&&(e=hp(e,1/i,r)),e}function aU(e,t=0,n=1,r=.5,i,o=e,s=e){if(Ri.test(t)&&(t=parseFloat(t),t=Jt(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Jt(o.min,o.max,r);e===o&&(a-=t),e.min=N_(e.min,t,n,a,i),e.max=N_(e.max,t,n,a,i)}function T_(e,t,[n,r,i],o,s){aU(e,t[n],t[r],t[i],t.scale,o,s)}const lU=["x","scaleX","originX"],uU=["y","scaleY","originY"];function A_(e,t,n,r){T_(e.x,t,lU,n?n.x:void 0,r?r.x:void 0),T_(e.y,t,uU,n?n.y:void 0,r?r.y:void 0)}function P_(e){return e.translate===0&&e.scale===1}function GM(e){return P_(e.x)&&P_(e.y)}function R_(e,t){return e.min===t.min&&e.max===t.max}function cU(e,t){return R_(e.x,t.x)&&R_(e.y,t.y)}function M_(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ZM(e,t){return M_(e.x,t.x)&&M_(e.y,t.y)}function D_(e){return Pr(e.x)/Pr(e.y)}function O_(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class dU{constructor(){this.members=[]}add(t){Hb(this.members,t),t.scheduleRender()}remove(t){if(Yb(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function fU(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:f,rotateX:h,rotateY:p,skewX:m,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotateX(${h}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,u=e.y.scale*t.y;return(a!==1||u!==1)&&(r+=`scale(${a}, ${u})`),r||"none"}const hU=(e,t)=>e.depth-t.depth;class pU{constructor(){this.children=[],this.isDirty=!1}add(t){Hb(this.children,t),this.isDirty=!0}remove(t){Yb(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(hU),this.isDirty=!1,this.children.forEach(t)}}function qh(e){const t=Vn(e)?e.get():e;return Q9(t)?t.toValue():t}function mU(e,t){const n=Mi.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(fs(r),e(o-t))};return Vt.read(r,!0),()=>fs(r)}function gU(e){return e instanceof SVGElement&&e.tagName!=="svg"}function yU(e,t,n){const r=Vn(e)?e:Bc(e);return r.start(Ub("",r,t,n)),r.animation}const qs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},hc=typeof window<"u"&&window.MotionDebug!==void 0,Sv=["","X","Y","Z"],vU={visibility:"hidden"},I_=1e3;let xU=0;function Ev(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function KM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=AM(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Vt,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&KM(r)}function XM({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=xU++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,hc&&(qs.totalNodes=qs.resolvedTargetDeltas=qs.recalculatedProjection=0),this.nodes.forEach(kU),this.nodes.forEach(NU),this.nodes.forEach(TU),this.nodes.forEach(SU),hc&&window.MotionDebug.record(qs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new pU)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new qb),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const u=this.eventHandlers.get(s);u&&u.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=gU(s),this.instance=s;const{layoutId:u,layout:c,visualElement:f}=this.options;if(f&&!f.current&&f.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||u)&&(this.isLayoutDirty=!0),e){let h;const p=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=mU(p,250),Yh.hasAnimatedSinceResize&&(Yh.hasAnimatedSinceResize=!1,this.nodes.forEach(L_))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&f&&(u||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeTargetChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||f.getDefaultTransition()||DU,{onLayoutAnimationStart:k,onLayoutAnimationComplete:w}=f.getProps(),E=!this.targetLayout||!ZM(this.targetLayout,y)||m,C=!p&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||C||p&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,C);const N={...Pb(x,"layout"),onPlay:k,onComplete:w};(f.shouldReduceMotion||this.options.layoutRoot)&&(N.delay=0,N.type=!1),this.startAnimation(N)}else p||L_(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,fs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(AU),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&KM(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const h=this.path[f];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:u}=this.options;if(a===void 0&&!u)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(j_);return}this.isUpdating||this.nodes.forEach(CU),this.isUpdating=!1,this.nodes.forEach(_U),this.nodes.forEach(wU),this.nodes.forEach(bU),this.clearAllSnapshots();const a=Mi.now();In.delta=xo(0,1e3/60,a-In.timestamp),In.timestamp=a,In.isProcessing=!0,pv.update.process(In),pv.preRender.process(In),pv.render.process(In),In.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Xb.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(EU),this.sharedNodes.forEach(PU)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Vt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Vt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=sn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!GM(this.projectionDelta),u=this.getTransformTemplate(),c=u?u(this.latestValues,""):void 0,f=c!==this.prevTransformTemplateValue;s&&(a||Ys(this.latestValues)||f)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let u=this.removeElementScroll(a);return s&&(u=this.removeTransform(u)),OU(u),{animationId:this.root.animationId,measuredBox:a,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var s;const{visualElement:a}=this.options;if(!a)return sn();const u=a.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(IU))){const{scroll:f}=this.root;f&&(fl(u.x,f.offset.x),fl(u.y,f.offset.y))}return u}removeElementScroll(s){var a;const u=sn();if(zr(u,s),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return u;for(let c=0;c<this.path.length;c++){const f=this.path[c],{scroll:h,options:p}=f;f!==this.root&&h&&p.layoutScroll&&(h.wasRoot&&zr(u,s),fl(u.x,h.offset.x),fl(u.y,h.offset.y))}return u}applyTransform(s,a=!1){const u=sn();zr(u,s);for(let c=0;c<this.path.length;c++){const f=this.path[c];!a&&f.options.layoutScroll&&f.scroll&&f!==f.root&&hl(u,{x:-f.scroll.offset.x,y:-f.scroll.offset.y}),Ys(f.latestValues)&&hl(u,f.latestValues)}return Ys(this.latestValues)&&hl(u,this.latestValues),u}removeTransform(s){const a=sn();zr(a,s);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!c.instance||!Ys(c.latestValues))continue;ew(c.latestValues)&&c.updateSnapshot();const f=sn(),h=c.measurePageBox();zr(f,h),A_(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,f)}return Ys(this.latestValues)&&A_(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==In.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var a;const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==u;if(!(s||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:p}=this.options;if(!(!this.layout||!(h||p))){if(this.resolvedRelativeTargetAt=In.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=sn(),this.relativeTargetOrigin=sn(),Cc(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),zr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=sn(),this.targetWithTransforms=sn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),jW(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):zr(this.target,this.layout.layoutBox),BM(this.target,this.targetDelta)):zr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=sn(),this.relativeTargetOrigin=sn(),Cc(this.relativeTargetOrigin,this.target,m.target),zr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}hc&&qs.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||ew(this.parent.latestValues)||$M(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;const a=this.getLead(),u=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(c=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===In.timestamp&&(c=!1),c)return;const{layout:f,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||h))return;zr(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;HW(this.layoutCorrected,this.treeScale,this.path,u),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=sn());const{target:y}=a;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(__(this.prevProjectionDelta.x,this.projectionDelta.x),__(this.prevProjectionDelta.y,this.projectionDelta.y)),Ec(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==m||!O_(this.projectionDelta.x,this.prevProjectionDelta.x)||!O_(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y)),hc&&qs.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),s){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=dl(),this.projectionDelta=dl(),this.projectionDeltaWithTransform=dl()}setAnimationOrigin(s,a=!1){const u=this.snapshot,c=u?u.latestValues:{},f={...this.latestValues},h=dl();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=sn(),m=u?u.source:void 0,y=this.layout?this.layout.source:void 0,x=m!==y,k=this.getStack(),w=!k||k.members.length<=1,E=!!(x&&!w&&this.options.crossfade===!0&&!this.path.some(MU));this.animationProgress=0;let C;this.mixTargetDelta=N=>{const P=N/1e3;F_(h.x,s.x,P),F_(h.y,s.y,P),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Cc(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),RU(this.relativeTarget,this.relativeTargetOrigin,p,P),C&&cU(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=sn()),zr(C,this.relativeTarget)),x&&(this.animationValues=f,iU(f,c,this.latestValues,P,E,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(fs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Vt.update(()=>{Yh.hasAnimatedSinceResize=!0,this.currentAnimation=yU(0,I_,{...s,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(I_),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:u,layout:c,latestValues:f}=s;if(!(!a||!u||!c)){if(this!==s&&this.layout&&c&&QM(this.options.animationType,this.layout.layoutBox,c.layoutBox)){u=this.target||sn();const h=Pr(this.layout.layoutBox.x);u.x.min=s.target.x.min,u.x.max=u.x.min+h;const p=Pr(this.layout.layoutBox.y);u.y.min=s.target.y.min,u.y.max=u.y.min+p}zr(a,u),hl(a,f),Ec(this.projectionDeltaWithTransform,this.layoutCorrected,a,f)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new dU),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:a}=this.options;return a?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:a}=this.options;return a?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:u}={}){const c=this.getStack();c&&c.promote(this,u),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:u}=s;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(a=!0),!a)return;const c={};u.z&&Ev("z",s,c,this.animationValues);for(let f=0;f<Sv.length;f++)Ev(`rotate${Sv[f]}`,s,c,this.animationValues),Ev(`skew${Sv[f]}`,s,c,this.animationValues);s.render();for(const f in c)s.setStaticValue(f,c[f]),this.animationValues&&(this.animationValues[f]=c[f]);s.scheduleRender()}getProjectionStyles(s){var a,u;if(!this.instance||this.isSVG)return;if(!this.isVisible)return vU;const c={visibility:""},f=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=qh(s==null?void 0:s.pointerEvents)||"",c.transform=f?f(this.latestValues,""):"none",c;const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){const x={};return this.options.layoutId&&(x.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,x.pointerEvents=qh(s==null?void 0:s.pointerEvents)||""),this.hasProjected&&!Ys(this.latestValues)&&(x.transform=f?f({},""):"none",this.hasProjected=!1),x}const p=h.animationValues||h.latestValues;this.applyTransformsToTarget(),c.transform=fU(this.projectionDeltaWithTransform,this.treeScale,p),f&&(c.transform=f(p,c.transform));const{x:m,y}=this.projectionDelta;c.transformOrigin=`${m.origin*100}% ${y.origin*100}% 0`,h.animationValues?c.opacity=h===this?(u=(a=p.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&u!==void 0?u:1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:c.opacity=h===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const x in pp){if(p[x]===void 0)continue;const{correct:k,applyTo:w}=pp[x],E=c.transform==="none"?p[x]:k(p[x],h);if(w){const C=w.length;for(let N=0;N<C;N++)c[w[N]]=E}else c[x]=E}return this.options.layoutId&&(c.pointerEvents=h===this?qh(s==null?void 0:s.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var a;return(a=s.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(j_),this.root.sharedNodes.clear()}}}function wU(e){e.updateLayout()}function bU(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,s=n.source!==e.layout.source;o==="size"?$r(h=>{const p=s?n.measuredBox[h]:n.layoutBox[h],m=Pr(p);p.min=r[h].min,p.max=p.min+m}):QM(o,n.layoutBox,r)&&$r(h=>{const p=s?n.measuredBox[h]:n.layoutBox[h],m=Pr(r[h]);p.max=p.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+m)});const a=dl();Ec(a,r,n.layoutBox);const u=dl();s?Ec(u,e.applyTransform(i,!0),n.measuredBox):Ec(u,r,n.layoutBox);const c=!GM(a);let f=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:m}=h;if(p&&m){const y=sn();Cc(y,n.layoutBox,p.layoutBox);const x=sn();Cc(x,r,m.layoutBox),ZM(y,x)||(f=!0),h.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=y,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:u,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:f})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function kU(e){hc&&qs.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function SU(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function EU(e){e.clearSnapshot()}function j_(e){e.clearMeasurements()}function CU(e){e.isLayoutDirty=!1}function _U(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function L_(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function NU(e){e.resolveTargetDelta()}function TU(e){e.calcProjection()}function AU(e){e.resetSkewAndRotation()}function PU(e){e.removeLeadSnapshot()}function F_(e,t,n){e.translate=Jt(t.translate,0,n),e.scale=Jt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function z_(e,t,n,r){e.min=Jt(t.min,n.min,r),e.max=Jt(t.max,n.max,r)}function RU(e,t,n,r){z_(e.x,t.x,n.x,r),z_(e.y,t.y,n.y,r)}function MU(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const DU={duration:.45,ease:[.4,0,.1,1]},$_=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),B_=$_("applewebkit/")&&!$_("chrome/")?Math.round:Cr;function V_(e){e.min=B_(e.min),e.max=B_(e.max)}function OU(e){V_(e.x),V_(e.y)}function QM(e,t,n){return e==="position"||e==="preserve-aspect"&&!IW(D_(t),D_(n),.2)}function IU(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const jU=XM({attachResizeListener:(e,t)=>Vc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Cv={current:void 0},JM=XM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Cv.current){const e=new jU({});e.mount(window),e.setOptions({layoutScroll:!0}),Cv.current=e}return Cv.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),LU={pan:{Feature:XW},drag:{Feature:KW,ProjectionNode:JM,MeasureLayout:HM}};function W_(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&Vt.postRender(()=>o(t,Pd(t)))}class FU extends Ss{mount(){const{current:t}=this.node;t&&(this.unmount=bW(t,n=>(W_(this.node,n,"Start"),r=>W_(this.node,r,"End"))))}unmount(){}}class zU extends Ss{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ad(Vc(this.node.current,"focus",()=>this.onFocus()),Vc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function U_(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=r[i];o&&Vt.postRender(()=>o(t,Pd(t)))}class $U extends Ss{mount(){const{current:t}=this.node;t&&(this.unmount=CW(t,n=>(U_(this.node,n,"Start"),(r,{success:i})=>U_(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const nw=new WeakMap,_v=new WeakMap,BU=e=>{const t=nw.get(e.target);t&&t(e)},VU=e=>{e.forEach(BU)};function WU({root:e,...t}){const n=e||document;_v.has(n)||_v.set(n,{});const r=_v.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(VU,{root:e,...t})),r[i]}function UU(e,t,n){const r=WU(t);return nw.set(e,n),r.observe(e),()=>{nw.delete(e),r.unobserve(e)}}const HU={some:0,all:1};class YU extends Ss{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:HU[i]},a=u=>{const{isIntersecting:c}=u;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),p=c?f:h;p&&p(u)};return UU(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(qU(t,n))&&this.startObserver()}unmount(){}}function qU({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const GU={inView:{Feature:YU},tap:{Feature:$U},focus:{Feature:zU},hover:{Feature:FU}},ZU={layout:{ProjectionNode:JM,MeasureLayout:HM}},Qb=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),pm=S.createContext({}),Jb=typeof window<"u",e2=Jb?S.useLayoutEffect:S.useEffect,t2=S.createContext({strict:!1});function KU(e,t,n,r,i){var o,s;const{visualElement:a}=S.useContext(pm),u=S.useContext(t2),c=S.useContext(hm),f=S.useContext(Qb).reducedMotion,h=S.useRef(null);r=r||u.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:f}));const p=h.current,m=S.useContext(UM);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&XU(h.current,n,i,m);const y=S.useRef(!1);S.useInsertionEffect(()=>{p&&y.current&&p.update(n,c)});const x=n[TM],k=S.useRef(!!x&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,x))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,x)));return e2(()=>{p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),Xb.render(p.render),k.current&&p.animationState&&p.animationState.animateChanges())}),S.useEffect(()=>{p&&(!k.current&&p.animationState&&p.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var w;(w=window.MotionHandoffMarkAsComplete)===null||w===void 0||w.call(window,x)}),k.current=!1))}),p}function XU(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:u,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:n2(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&cl(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,layoutScroll:u,layoutRoot:c})}function n2(e){if(e)return e.options.allowProjection!==!1?e.projection:n2(e.parent)}function QU(e,t,n){return S.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):cl(n)&&(n.current=r))},[t])}function mm(e){return cm(e.animate)||Ab.some(t=>Fc(e[t]))}function r2(e){return!!(mm(e)||e.variants)}function JU(e,t){if(mm(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Fc(n)?n:void 0,animate:Fc(r)?r:void 0}}return e.inherit!==!1?t:{}}function e7(e){const{initial:t,animate:n}=JU(e,S.useContext(pm));return S.useMemo(()=>({initial:t,animate:n}),[H_(t),H_(n)])}function H_(e){return Array.isArray(e)?e.join(" "):e}const Y_={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Rl={};for(const e in Y_)Rl[e]={isEnabled:t=>Y_[e].some(n=>!!t[n])};function t7(e){for(const t in e)Rl[t]={...Rl[t],...e[t]}}const n7=Symbol.for("motionComponentSymbol");function r7({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&t7(e);function o(a,u){let c;const f={...S.useContext(Qb),...a,layoutId:i7(a)},{isStatic:h}=f,p=e7(a),m=r(a,h);if(!h&&Jb){o7();const y=s7(f);c=y.MeasureLayout,p.visualElement=KU(i,m,f,t,y.ProjectionNode)}return v.jsxs(pm.Provider,{value:p,children:[c&&p.visualElement?v.jsx(c,{visualElement:p.visualElement,...f}):null,n(i,a,QU(m,p.visualElement,u),m,h,p.visualElement)]})}const s=S.forwardRef(o);return s[n7]=i,s}function i7({layoutId:e}){const t=S.useContext(Kb).id;return t&&e!==void 0?t+"-"+e:e}function o7(e,t){S.useContext(t2).strict}function s7(e){const{drag:t,layout:n}=Rl;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const a7=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function e1(e){return typeof e!="string"||e.includes("-")?!1:!!(a7.indexOf(e)>-1||/[A-Z]/u.test(e))}function i2(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const o2=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function s2(e,t,n,r){i2(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(o2.has(i)?i:Gb(i),t.attrs[i])}function a2(e,{layout:t,layoutId:n}){return xa.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!pp[e]||e==="opacity")}function t1(e,t,n){var r;const{style:i}=e,o={};for(const s in i)(Vn(i[s])||t.style&&Vn(t.style[s])||a2(s,e)||((r=n==null?void 0:n.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(o[s]=i[s]);return o}function l2(e,t,n){const r=t1(e,t,n);for(const i in e)if(Vn(e[i])||Vn(t[i])){const o=_d.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}function n1(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}function l7({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const s={latestValues:u7(r,i,o,e),renderState:t()};return n&&(s.mount=a=>n(r,a,s)),s}const u2=e=>(t,n)=>{const r=S.useContext(pm),i=S.useContext(hm),o=()=>l7(e,t,r,i);return n?o():n1(o)};function u7(e,t,n,r){const i={},o=r(e,{});for(const p in o)i[p]=qh(o[p]);let{initial:s,animate:a}=e;const u=mm(e),c=r2(e);t&&c&&!u&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let f=n?n.initial===!1:!1;f=f||s===!1;const h=f?a:s;if(h&&typeof h!="boolean"&&!cm(h)){const p=Array.isArray(h)?h:[h];for(let m=0;m<p.length;m++){const y=Nb(e,p[m]);if(y){const{transitionEnd:x,transition:k,...w}=y;for(const E in w){let C=w[E];if(Array.isArray(C)){const N=f?C.length-1:0;C=C[N]}C!==null&&(i[E]=C)}for(const E in x)i[E]=x[E]}}}return i}const r1=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),c2=()=>({...r1(),attrs:{}}),d2=(e,t)=>t&&typeof e=="number"?t.transform(e):e,c7={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},d7=_d.length;function f7(e,t,n){let r="",i=!0;for(let o=0;o<d7;o++){const s=_d[o],a=e[s];if(a===void 0)continue;let u=!0;if(typeof a=="number"?u=a===(s.startsWith("scale")?1:0):u=parseFloat(a)===0,!u||n){const c=d2(a,Lb[s]);if(!u){i=!1;const f=c7[s]||s;r+=`${f}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function i1(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let s=!1,a=!1;for(const u in t){const c=t[u];if(xa.has(u)){s=!0;continue}else if(rM(u)){i[u]=c;continue}else{const f=d2(c,Lb[u]);u.startsWith("origin")?(a=!0,o[u]=f):r[u]=f}}if(t.transform||(s||n?r.transform=f7(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:u="50%",originY:c="50%",originZ:f=0}=o;r.transformOrigin=`${u} ${c} ${f}`}}function q_(e,t,n){return typeof e=="string"?e:Qe.transform(t+n*e)}function h7(e,t,n){const r=q_(t,e.x,e.width),i=q_(n,e.y,e.height);return`${r} ${i}`}const p7={offset:"stroke-dashoffset",array:"stroke-dasharray"},m7={offset:"strokeDashoffset",array:"strokeDasharray"};function g7(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?p7:m7;e[o.offset]=Qe.transform(-r);const s=Qe.transform(t),a=Qe.transform(n);e[o.array]=`${s} ${a}`}function o1(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:u=0,...c},f,h){if(i1(e,c,h),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:m,dimensions:y}=e;p.transform&&(y&&(m.transform=p.transform),delete p.transform),y&&(i!==void 0||o!==void 0||m.transform)&&(m.transformOrigin=h7(y,i!==void 0?i:.5,o!==void 0?o:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&g7(p,s,a,u,!1)}const s1=e=>typeof e=="string"&&e.toLowerCase()==="svg",y7={useVisualState:u2({scrapeMotionValuesFromProps:l2,createRenderState:c2,onMount:(e,t,{renderState:n,latestValues:r})=>{Vt.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Vt.render(()=>{o1(n,r,s1(t.tagName),e.transformTemplate),s2(t,n)})}})},v7={useVisualState:u2({scrapeMotionValuesFromProps:t1,createRenderState:r1})};function f2(e,t,n){for(const r in t)!Vn(t[r])&&!a2(r,n)&&(e[r]=t[r])}function x7({transformTemplate:e},t){return S.useMemo(()=>{const n=r1();return i1(n,t,e),Object.assign({},n.vars,n.style)},[t])}function w7(e,t){const n=e.style||{},r={};return f2(r,n,e),Object.assign(r,x7(e,t)),r}function b7(e,t){const n={},r=w7(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const k7=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function mp(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||k7.has(e)}let h2=e=>!mp(e);function S7(e){e&&(h2=t=>t.startsWith("on")?!mp(t):e(t))}try{S7(require("@emotion/is-prop-valid").default)}catch{}function E7(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(h2(i)||n===!0&&mp(i)||!t&&!mp(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function C7(e,t,n,r){const i=S.useMemo(()=>{const o=c2();return o1(o,t,s1(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};f2(o,e.style,e),i.style={...o,...i.style}}return i}function _7(e=!1){return(n,r,i,{latestValues:o},s)=>{const u=(e1(n)?C7:b7)(r,o,s,n),c=E7(r,typeof n=="string",e),f=n!==S.Fragment?{...c,...u,ref:i}:{},{children:h}=r,p=S.useMemo(()=>Vn(h)?h.get():h,[h]);return S.createElement(n,{...f,children:p})}}function N7(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...e1(r)?y7:v7,preloadedFeatures:e,useRender:_7(i),createVisualElement:t,Component:r};return r7(s)}}const rw={current:null},p2={current:!1};function T7(){if(p2.current=!0,!!Jb)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>rw.current=e.matches;e.addListener(t),t()}else rw.current=!1}function A7(e,t,n){for(const r in t){const i=t[r],o=n[r];if(Vn(i))e.addValue(r,i);else if(Vn(o))e.addValue(r,Bc(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,Bc(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const G_=new WeakMap,P7=[...sM,$n,hs],R7=e=>P7.find(oM(e)),Z_=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class M7{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ob,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Mi.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,Vt.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=s;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=mm(n),this.isVariantNode=r2(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const m=h[p];u[p]!==void 0&&Vn(m)&&m.set(u[p],!1)}}mount(t){this.current=t,G_.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),p2.current||T7(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:rw.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){G_.delete(this.current),this.projection&&this.projection.unmount(),fs(this.notifyUpdate),fs(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=xa.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Vt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Rl){const n=Rl[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):sn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Z_.length;r++){const i=Z_[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,s=t[o];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=A7(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Bc(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(tM(i)||eM(i))?i=parseFloat(i):!R7(i)&&hs.test(n)&&(i=pM(t,n)),this.setBaseTarget(t,Vn(i)?i.get():i)),Vn(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const s=Nb(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);s&&(i=s[t])}if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Vn(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new qb),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class m2 extends M7{constructor(){super(...arguments),this.KeyframeResolver=mM}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Vn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function D7(e){return window.getComputedStyle(e)}class O7 extends m2{constructor(){super(...arguments),this.type="html",this.renderInstance=i2}readValueFromInstance(t,n){if(xa.has(n)){const r=Fb(n);return r&&r.default||0}else{const r=D7(t),i=(rM(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return VM(t,n)}build(t,n,r){i1(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return t1(t,n,r)}}class I7 extends m2{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=sn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(xa.has(n)){const r=Fb(n);return r&&r.default||0}return n=o2.has(n)?n:Gb(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return l2(t,n,r)}build(t,n,r){o1(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){s2(t,n,r,i)}mount(t){this.isSVGTag=s1(t.tagName),super.mount(t)}}const j7=(e,t)=>e1(e)?new I7(t):new O7(t,{allowProjection:e!==S.Fragment}),L7=N7({...xW,...GU,...LU,...ZU},j7),gm=y8(L7);class F7 extends S.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function z7({children:e,isPresent:t}){const n=S.useId(),r=S.useRef(null),i=S.useRef({width:0,height:0,top:0,left:0}),{nonce:o}=S.useContext(Qb);return S.useInsertionEffect(()=>{const{width:s,height:a,top:u,left:c}=i.current;if(t||!r.current||!s||!a)return;r.current.dataset.motionPopId=n;const f=document.createElement("style");return o&&(f.nonce=o),document.head.appendChild(f),f.sheet&&f.sheet.insertRule(`
201
+ [data-motion-pop-id="${n}"] {
202
+ position: absolute !important;
203
+ width: ${s}px !important;
204
+ height: ${a}px !important;
205
+ top: ${u}px !important;
206
+ left: ${c}px !important;
207
+ }
208
+ `),()=>{document.head.removeChild(f)}},[t]),v.jsx(F7,{isPresent:t,childRef:r,sizeRef:i,children:S.cloneElement(e,{ref:r})})}const $7=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s})=>{const a=n1(B7),u=S.useId(),c=S.useCallback(h=>{a.set(h,!0);for(const p of a.values())if(!p)return;r&&r()},[a,r]),f=S.useMemo(()=>({id:u,initial:t,isPresent:n,custom:i,onExitComplete:c,register:h=>(a.set(h,!1),()=>a.delete(h))}),o?[Math.random(),c]:[n,c]);return S.useMemo(()=>{a.forEach((h,p)=>a.set(p,!1))},[n]),S.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),s==="popLayout"&&(e=v.jsx(z7,{isPresent:n,children:e})),v.jsx(hm.Provider,{value:f,children:e})};function B7(){return new Map}const Sh=e=>e.key||"";function K_(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const g2=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:o=!0,mode:s="sync"})=>{const a=S.useMemo(()=>K_(e),[e]),u=a.map(Sh),c=S.useRef(!0),f=S.useRef(a),h=n1(()=>new Map),[p,m]=S.useState(a),[y,x]=S.useState(a);e2(()=>{c.current=!1,f.current=a;for(let E=0;E<y.length;E++){const C=Sh(y[E]);u.includes(C)?h.delete(C):h.get(C)!==!0&&h.set(C,!1)}},[y,u.length,u.join("-")]);const k=[];if(a!==p){let E=[...a];for(let C=0;C<y.length;C++){const N=y[C],P=Sh(N);u.includes(P)||(E.splice(C,0,N),k.push(N))}s==="wait"&&k.length&&(E=k),x(K_(E)),m(a);return}const{forceRender:w}=S.useContext(Kb);return v.jsx(v.Fragment,{children:y.map(E=>{const C=Sh(E),N=a===y||u.includes(C),P=()=>{if(h.has(C))h.set(C,!0);else return;let A=!0;h.forEach(O=>{O||(A=!1)}),A&&(w==null||w(),x(f.current),i&&i())};return v.jsx($7,{isPresent:N,initial:!c.current||r?void 0:!1,custom:N?void 0:n,presenceAffectsLayout:o,mode:s,onExitComplete:N?void 0:P,children:E},C)})})};function V7(e,t,n){let r=i=>e(i,...t);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:t})}function y2(e,t,n){let r=e.length-t.length;if(r===0)return e(...t);if(r===1)return V7(e,t,n);throw new Error("Wrong number of arguments")}function X_(...e){return y2(W7,e)}var W7=(e,t)=>e.length>=t;function Q_(...e){return y2(U7,e)}function U7(e,t){if(!X_(t,1))return{...e};if(!X_(t,2)){let{[t[0]]:r,...i}=e;return i}let n={...e};for(let r of t)delete n[r];return n}const a1=ne.forwardRef((e,t)=>e.file.type.startsWith("image/")?v.jsx(v2,{...e,ref:t}):e.file.type.startsWith("text/")||e.file.name.endsWith(".txt")||e.file.name.endsWith(".md")?v.jsx(x2,{...e,ref:t}):v.jsx(w2,{...e,ref:t}));a1.displayName="FilePreview";const v2=ne.forwardRef(({file:e,onRemove:t},n)=>v.jsxs(gm.div,{ref:n,className:"relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",layout:!0,initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},children:[v.jsxs("div",{className:"flex w-full items-center space-x-2",children:[v.jsx("img",{alt:`Attachment ${e.name}`,className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted object-cover",src:URL.createObjectURL(e)}),v.jsx("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?v.jsx("button",{className:"absolute -right-2 -top-2 flex h-4 w-4 items-center justify-center rounded-full border bg-background",type:"button",onClick:t,"aria-label":"Remove attachment",children:v.jsx(va,{className:"h-2.5 w-2.5"})}):null]}));v2.displayName="ImageFilePreview";const x2=ne.forwardRef(({file:e,onRemove:t},n)=>{const[r,i]=ne.useState("");return S.useEffect(()=>{const o=new FileReader;o.onload=s=>{var u;const a=(u=s.target)==null?void 0:u.result;i(a.slice(0,50)+(a.length>50?"...":""))},o.readAsText(e)},[e]),v.jsxs(gm.div,{ref:n,className:"relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",layout:!0,initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},children:[v.jsxs("div",{className:"flex w-full items-center space-x-2",children:[v.jsx("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted p-0.5",children:v.jsx("div",{className:"h-full w-full overflow-hidden text-[6px] leading-none text-muted-foreground",children:r||"Loading..."})}),v.jsx("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?v.jsx("button",{className:"absolute -right-2 -top-2 flex h-4 w-4 items-center justify-center rounded-full border bg-background",type:"button",onClick:t,"aria-label":"Remove attachment",children:v.jsx(va,{className:"h-2.5 w-2.5"})}):null]})});x2.displayName="TextFilePreview";const w2=ne.forwardRef(({file:e,onRemove:t},n)=>v.jsxs(gm.div,{ref:n,className:"relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",layout:!0,initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},children:[v.jsxs("div",{className:"flex w-full items-center space-x-2",children:[v.jsx("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted",children:v.jsx(YB,{className:"h-6 w-6 text-foreground"})}),v.jsx("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?v.jsx("button",{className:"absolute -right-2 -top-2 flex h-4 w-4 items-center justify-center rounded-full border bg-background",type:"button",onClick:t,"aria-label":"Remove attachment",children:v.jsx(va,{className:"h-2.5 w-2.5"})}):null]}));w2.displayName="GenericFilePreview";function H7({ref:e,maxHeight:t=Number.MAX_SAFE_INTEGER,borderWidth:n=0,dependencies:r}){const i=S.useRef(null);S.useLayoutEffect(()=>{if(!e.current)return;const o=e.current,s=n*2;i.current===null&&(i.current=o.scrollHeight-s),o.style.removeProperty("height");const a=o.scrollHeight,u=Math.min(a,t),c=Math.max(u,i.current);o.style.height=`${c+s}px`},[t,e,...r])}function b2({placeholder:e="Ask AI...",className:t,onKeyDown:n,submitOnEnter:r=!0,stop:i,isGenerating:o,...s}){var w;const[a,u]=S.useState(!1),c=E=>{s.allowAttachments&&s.setFiles(C=>C===null?E:E===null?C:[...C,...E])},f=E=>{s.allowAttachments===!0&&(E.preventDefault(),u(!0))},h=E=>{s.allowAttachments===!0&&(E.preventDefault(),u(!1))},p=E=>{if(u(!1),s.allowAttachments!==!0)return;E.preventDefault();const C=E.dataTransfer;C.files.length&&c(Array.from(C.files))},m=E=>{var P;const C=(P=E.clipboardData)==null?void 0:P.items;if(!C)return;const N=Array.from(C).map(A=>A.getAsFile()).filter(A=>A!==null);s.allowAttachments&&N.length>0&&c(N)},y=E=>{var C;r&&E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),(C=E.currentTarget.form)==null||C.requestSubmit()),n==null||n(E)},x=S.useRef(null),k=s.allowAttachments&&s.files&&s.files.length>0;return H7({ref:x,maxHeight:240,borderWidth:1,dependencies:[s.value,k]}),v.jsxs("div",{className:"relative flex w-full",onDragOver:f,onDragLeave:h,onDrop:p,children:[v.jsx("textarea",{"aria-label":"Write your prompt here",placeholder:e,ref:x,onPaste:m,onKeyDown:y,className:Te("w-full grow resize-none rounded-xl border border-input bg-transparent p-3 pr-24 text-sm ring-offset-background transition-[border] placeholder:text-muted-foreground focus-visible:border-primary focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",k&&"pb-16",t),...s.allowAttachments?Q_(s,["allowAttachments","files","setFiles"]):Q_(s,["allowAttachments"])}),s.allowAttachments&&v.jsx("div",{className:"absolute inset-x-3 bottom-0 overflow-x-scroll py-3",children:v.jsx("div",{className:"flex space-x-3",children:v.jsx(g2,{mode:"popLayout",children:(w=s.files)==null?void 0:w.map(E=>v.jsx(a1,{file:E,onRemove:()=>{s.setFiles(C=>{if(!C)return null;const N=Array.from(C).filter(P=>P!==E);return N.length===0?null:N})}},E.name+String(E.lastModified)))})})}),v.jsxs("div",{className:"absolute right-3 top-3 flex gap-2",children:[s.allowAttachments&&v.jsx(Bt,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":"Attach a file",onClick:async()=>{const E=await q7();c(E)},children:v.jsx(cR,{className:"h-4 w-4"})}),o&&i?v.jsx(Bt,{type:"button",size:"icon",className:"h-8 w-8","aria-label":"Stop generating",onClick:i,children:v.jsx(XB,{className:"h-3 w-3 animate-pulse",fill:"currentColor"})}):v.jsx(Bt,{type:"submit",size:"icon",className:"h-8 w-8 transition-opacity","aria-label":"Send message",disabled:s.value===""||o,children:v.jsx($B,{className:"h-5 w-5"})})]}),s.allowAttachments&&v.jsx(Y7,{isDragging:a})]})}b2.displayName="MessageInput";function Y7({isDragging:e}){return v.jsx(g2,{children:e&&v.jsxs(gm.div,{className:"pointer-events-none absolute inset-0 flex items-center justify-center space-x-2 rounded-xl border border-dashed border-border bg-background text-sm text-muted-foreground",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},"aria-hidden":!0,children:[v.jsx(cR,{className:"h-4 w-4"}),v.jsx("span",{children:"Drop your files here to attach them."})]})})}function q7(){const e=document.createElement("input");return e.type="file",e.multiple=!0,e.accept="*/*",e.click(),new Promise(t=>{e.onchange=n=>{const r=n.currentTarget.files;if(r){t(Array.from(r));return}t(null)}})}function G7(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Z7=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,K7=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,X7={};function J_(e,t){return(X7.jsx?K7:Z7).test(e)}const Q7=/[ \t\n\f\r]/g;function J7(e){return typeof e=="object"?e.type==="text"?eN(e.value):!1:eN(e)}function eN(e){return e.replace(Q7,"")===""}class Rd{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Rd.prototype.property={};Rd.prototype.normal={};Rd.prototype.space=null;function k2(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new Rd(n,r,t)}function iw(e){return e.toLowerCase()}class Gr{constructor(t,n){this.property=t,this.attribute=n}}Gr.prototype.space=null;Gr.prototype.boolean=!1;Gr.prototype.booleanish=!1;Gr.prototype.overloadedBoolean=!1;Gr.prototype.number=!1;Gr.prototype.commaSeparated=!1;Gr.prototype.spaceSeparated=!1;Gr.prototype.commaOrSpaceSeparated=!1;Gr.prototype.mustUseProperty=!1;Gr.prototype.defined=!1;let eH=0;const ot=wa(),dn=wa(),S2=wa(),Ee=wa(),Dt=wa(),wl=wa(),wr=wa();function wa(){return 2**++eH}const ow=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:dn,commaOrSpaceSeparated:wr,commaSeparated:wl,number:Ee,overloadedBoolean:S2,spaceSeparated:Dt},Symbol.toStringTag,{value:"Module"})),Nv=Object.keys(ow);class l1 extends Gr{constructor(t,n,r,i){let o=-1;if(super(t,n),tN(this,"space",i),typeof r=="number")for(;++o<Nv.length;){const s=Nv[o];tN(this,Nv[o],(r&ow[s])===ow[s])}}}l1.prototype.defined=!0;function tN(e,t,n){n&&(e[t]=n)}const tH={}.hasOwnProperty;function iu(e){const t={},n={};let r;for(r in e.properties)if(tH.call(e.properties,r)){const i=e.properties[r],o=new l1(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[iw(r)]=r,n[iw(o.attribute)]=r}return new Rd(t,n,e.space)}const E2=iu({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),C2=iu({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function _2(e,t){return t in e?e[t]:t}function N2(e,t){return _2(e,t.toLowerCase())}const T2=iu({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:N2,properties:{xmlns:null,xmlnsXLink:null}}),A2=iu({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:dn,ariaAutoComplete:null,ariaBusy:dn,ariaChecked:dn,ariaColCount:Ee,ariaColIndex:Ee,ariaColSpan:Ee,ariaControls:Dt,ariaCurrent:null,ariaDescribedBy:Dt,ariaDetails:null,ariaDisabled:dn,ariaDropEffect:Dt,ariaErrorMessage:null,ariaExpanded:dn,ariaFlowTo:Dt,ariaGrabbed:dn,ariaHasPopup:null,ariaHidden:dn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Dt,ariaLevel:Ee,ariaLive:null,ariaModal:dn,ariaMultiLine:dn,ariaMultiSelectable:dn,ariaOrientation:null,ariaOwns:Dt,ariaPlaceholder:null,ariaPosInSet:Ee,ariaPressed:dn,ariaReadOnly:dn,ariaRelevant:null,ariaRequired:dn,ariaRoleDescription:Dt,ariaRowCount:Ee,ariaRowIndex:Ee,ariaRowSpan:Ee,ariaSelected:dn,ariaSetSize:Ee,ariaSort:null,ariaValueMax:Ee,ariaValueMin:Ee,ariaValueNow:Ee,ariaValueText:null,role:null}}),nH=iu({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:N2,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:wl,acceptCharset:Dt,accessKey:Dt,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:Dt,autoFocus:ot,autoPlay:ot,blocking:Dt,capture:null,charSet:null,checked:ot,cite:null,className:Dt,cols:Ee,colSpan:null,content:null,contentEditable:dn,controls:ot,controlsList:Dt,coords:Ee|wl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:S2,draggable:dn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:Dt,height:Ee,hidden:ot,high:Ee,href:null,hrefLang:null,htmlFor:Dt,httpEquiv:Dt,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:Dt,itemRef:Dt,itemScope:ot,itemType:Dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:Ee,manifest:null,max:null,maxLength:Ee,media:null,method:null,min:null,minLength:Ee,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ot,optimum:Ee,pattern:null,ping:Dt,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:Dt,required:ot,reversed:ot,rows:Ee,rowSpan:Ee,sandbox:Dt,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shape:null,size:Ee,sizes:null,slot:null,span:Ee,spellCheck:dn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ee,step:null,style:null,tabIndex:Ee,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:dn,width:Ee,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Dt,axis:null,background:null,bgColor:null,border:Ee,borderColor:null,bottomMargin:Ee,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:Ee,leftMargin:Ee,link:null,longDesc:null,lowSrc:null,marginHeight:Ee,marginWidth:Ee,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:Ee,rules:null,scheme:null,scrolling:dn,standby:null,summary:null,text:null,topMargin:Ee,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ee,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ot,disableRemotePlayback:ot,prefix:null,property:null,results:Ee,security:null,unselectable:null}}),rH=iu({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:_2,properties:{about:wr,accentHeight:Ee,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ee,amplitude:Ee,arabicForm:null,ascent:Ee,attributeName:null,attributeType:null,azimuth:Ee,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ee,by:null,calcMode:null,capHeight:Ee,className:Dt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ee,diffuseConstant:Ee,direction:null,display:null,dur:null,divisor:Ee,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ee,enableBackground:null,end:null,event:null,exponent:Ee,externalResourcesRequired:null,fill:null,fillOpacity:Ee,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:wl,g2:wl,glyphName:wl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ee,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ee,horizOriginX:Ee,horizOriginY:Ee,id:null,ideographic:Ee,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ee,k:Ee,k1:Ee,k2:Ee,k3:Ee,k4:Ee,kernelMatrix:wr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ee,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ee,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ee,overlineThickness:Ee,paintOrder:null,panose1:null,path:null,pathLength:Ee,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Dt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ee,pointsAtY:Ee,pointsAtZ:Ee,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:wr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:wr,rev:wr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:wr,requiredFeatures:wr,requiredFonts:wr,requiredFormats:wr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ee,specularExponent:Ee,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ee,strikethroughThickness:Ee,string:null,stroke:null,strokeDashArray:wr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ee,strokeOpacity:Ee,strokeWidth:null,style:null,surfaceScale:Ee,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:wr,tabIndex:Ee,tableValues:null,target:null,targetX:Ee,targetY:Ee,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:wr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ee,underlineThickness:Ee,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ee,values:null,vAlphabetic:Ee,vMathematical:Ee,vectorEffect:null,vHanging:Ee,vIdeographic:Ee,version:null,vertAdvY:Ee,vertOriginX:Ee,vertOriginY:Ee,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ee,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),iH=/^data[-\w.:]+$/i,nN=/-[a-z]/g,oH=/[A-Z]/g;function sH(e,t){const n=iw(t);let r=t,i=Gr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&iH.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(nN,lH);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!nN.test(o)){let s=o.replace(oH,aH);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=l1}return new i(r,t)}function aH(e){return"-"+e.toLowerCase()}function lH(e){return e.charAt(1).toUpperCase()}const uH={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},cH=k2([C2,E2,T2,A2,nH],"html"),u1=k2([C2,E2,T2,A2,rH],"svg");function dH(e){return e.join(" ").trim()}var tc={},Tv,rN;function fH(){if(rN)return Tv;rN=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
209
+ `,c="/",f="*",h="",p="comment",m="declaration";Tv=function(x,k){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];k=k||{};var w=1,E=1;function C(H){var I=H.match(t);I&&(w+=I.length);var Y=H.lastIndexOf(u);E=~Y?H.length-Y:E+H.length}function N(){var H={line:w,column:E};return function(I){return I.position=new P(H),M(),I}}function P(H){this.start=H,this.end={line:w,column:E},this.source=k.source}P.prototype.content=x;function A(H){var I=new Error(k.source+":"+w+":"+E+": "+H);if(I.reason=H,I.filename=k.source,I.line=w,I.column=E,I.source=x,!k.silent)throw I}function O(H){var I=H.exec(x);if(I){var Y=I[0];return C(Y),x=x.slice(Y.length),I}}function M(){O(n)}function j(H){var I;for(H=H||[];I=R();)I!==!1&&H.push(I);return H}function R(){var H=N();if(!(c!=x.charAt(0)||f!=x.charAt(1))){for(var I=2;h!=x.charAt(I)&&(f!=x.charAt(I)||c!=x.charAt(I+1));)++I;if(I+=2,h===x.charAt(I-1))return A("End of comment missing");var Y=x.slice(2,I-2);return E+=2,C(Y),x=x.slice(I),E+=2,H({type:p,comment:Y})}}function $(){var H=N(),I=O(r);if(I){if(R(),!O(i))return A("property missing ':'");var Y=O(o),q=H({type:m,property:y(I[0].replace(e,h)),value:Y?y(Y[0].replace(e,h)):h});return O(s),q}}function F(){var H=[];j(H);for(var I;I=$();)I!==!1&&(H.push(I),j(H));return H}return M(),F()};function y(x){return x?x.replace(a,h):h}return Tv}var iN;function hH(){if(iN)return tc;iN=1;var e=tc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(tc,"__esModule",{value:!0}),tc.default=n;var t=e(fH());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var s=(0,t.default)(r),a=typeof i=="function";return s.forEach(function(u){if(u.type==="declaration"){var c=u.property,f=u.value;a?i(c,f,u):f&&(o=o||{},o[c]=f)}}),o}return tc}var pH=hH();const oN=Zl(pH),mH=oN.default||oN,P2=R2("end"),c1=R2("start");function R2(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function gH(e){const t=c1(e),n=P2(e);if(t&&n)return{start:t,end:n}}function _c(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?sN(e.position):"start"in e||"end"in e?sN(e):"line"in e||"column"in e?sw(e):""}function sw(e){return aN(e&&e.line)+":"+aN(e&&e.column)}function sN(e){return sw(e&&e.start)+"-"+sw(e&&e.end)}function aN(e){return e&&typeof e=="number"?e:1}class Yn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=_c(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Yn.prototype.file="";Yn.prototype.name="";Yn.prototype.reason="";Yn.prototype.message="";Yn.prototype.stack="";Yn.prototype.column=void 0;Yn.prototype.line=void 0;Yn.prototype.ancestors=void 0;Yn.prototype.cause=void 0;Yn.prototype.fatal=void 0;Yn.prototype.place=void 0;Yn.prototype.ruleId=void 0;Yn.prototype.source=void 0;const d1={}.hasOwnProperty,yH=new Map,vH=/[A-Z]/g,xH=/-([a-z])/g,wH=new Set(["table","tbody","thead","tfoot","tr"]),bH=new Set(["td","th"]),M2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kH(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=PH(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=AH(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?u1:cH,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=D2(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function D2(e,t,n){if(t.type==="element")return SH(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return EH(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return _H(e,t,n);if(t.type==="mdxjsEsm")return CH(e,t);if(t.type==="root")return NH(e,t,n);if(t.type==="text")return TH(e,t)}function SH(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=u1,e.schema=i),e.ancestors.push(t);const o=I2(e,t.tagName,!1),s=RH(e,t);let a=h1(e,t);return wH.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!J7(u):!0})),O2(e,s,o,t),f1(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function EH(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Wc(e,t.position)}function CH(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Wc(e,t.position)}function _H(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=u1,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:I2(e,t.name,!0),s=MH(e,t),a=h1(e,t);return O2(e,s,o,t),f1(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function NH(e,t,n){const r={};return f1(r,h1(e,t)),e.create(t,e.Fragment,r,n)}function TH(e,t){return t.value}function O2(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function f1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function AH(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function PH(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),u=c1(r);return t(i,o,s,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function RH(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&d1.call(t.properties,i)){const o=DH(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&bH.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function MH(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Wc(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Wc(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function h1(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:yH;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const c=i.get(u)||0;s=u+"-"+c,i.set(u,c+1)}}const a=D2(e,o,s);a!==void 0&&n.push(a)}return n}function DH(e,t,n){const r=sH(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?G7(n):dH(n)),r.property==="style"){let i=typeof n=="object"?n:OH(e,String(n));return e.stylePropertyNameCase==="css"&&(i=IH(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?uH[r.property]||r.property:r.attribute,n]}}function OH(e,t){const n={};try{mH(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,s=new Yn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=M2+"#cannot-parse-style-attribute",s}}return n;function r(i,o){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(xH,LH)),n[s]=o}}function I2(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=J_(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=J_(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return d1.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Wc(e)}function Wc(e,t){const n=new Yn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=M2+"#cannot-handle-mdx-estrees-without-createevaluater",n}function IH(e){const t={};let n;for(n in e)d1.call(e,n)&&(t[jH(n)]=e[n]);return t}function jH(e){let t=e.replace(vH,FH);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function LH(e,t){return t.toUpperCase()}function FH(e){return"-"+e.toLowerCase()}const Av={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},zH={};function p1(e,t){const n=zH,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return j2(e,r,i)}function j2(e,t,n){if($H(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return lN(e.children,t,n)}return Array.isArray(e)?lN(e,t,n):""}function lN(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=j2(e[i],t,n);return r.join("")}function $H(e){return!!(e&&typeof e=="object")}const uN=document.createElement("i");function m1(e){const t="&"+e+";";uN.innerHTML=t;const n=uN.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function _r(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Vr(e,t){return e.length>0?(_r(e,e.length,0,t),e):t}const cN={}.hasOwnProperty;function L2(e){const t={};let n=-1;for(;++n<e.length;)BH(t,e[n]);return t}function BH(e,t){let n;for(n in t){const i=(cN.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){cN.call(i,s)||(i[s]=[]);const a=o[s];VH(i[s],Array.isArray(a)?a:a?[a]:[])}}}function VH(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);_r(e,0,0,r)}function F2(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ui(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const er=Es(/[A-Za-z]/),Wn=Es(/[\dA-Za-z]/),WH=Es(/[#-'*+\--9=?A-Z^-~]/);function gp(e){return e!==null&&(e<32||e===127)}const aw=Es(/\d/),UH=Es(/[\dA-Fa-f]/),HH=Es(/[!-/:-@[-`{-~]/);function Ze(e){return e!==null&&e<-2}function Pt(e){return e!==null&&(e<0||e===32)}function mt(e){return e===-2||e===-1||e===32}const ym=Es(new RegExp("\\p{P}|\\p{S}","u")),aa=Es(/\s/);function Es(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ou(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&Wn(e.charCodeAt(n+1))&&Wn(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function xt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(u){return mt(u)?(e.enter(n),a(u)):t(u)}function a(u){return mt(u)&&o++<i?(e.consume(u),a):(e.exit(n),t(u))}}const YH={tokenize:qH};function qH(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),xt(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Ze(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const GH={tokenize:ZH},dN={tokenize:KH};function ZH(e){const t=this,n=[];let r=0,i,o,s;return a;function a(C){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,u,c)(C)}return c(C)}function u(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const N=t.events.length;let P=N,A;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){A=t.events[P][1].end;break}w(r);let O=N;for(;O<t.events.length;)t.events[O][1].end={...A},O++;return _r(t.events,P+1,0,t.events.slice(N)),t.events.length=O,c(C)}return a(C)}function c(C){if(r===n.length){if(!i)return p(C);if(i.currentConstruct&&i.currentConstruct.concrete)return y(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dN,f,h)(C)}function f(C){return i&&E(),w(r),p(C)}function h(C){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,y(C)}function p(C){return t.containerState={},e.attempt(dN,m,y)(C)}function m(C){return r++,n.push([t.currentConstruct,t.containerState]),p(C)}function y(C){if(C===null){i&&E(),w(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),x(C)}function x(C){if(C===null){k(e.exit("chunkFlow"),!0),w(0),e.consume(C);return}return Ze(C)?(e.consume(C),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),x)}function k(C,N){const P=t.sliceStream(C);if(N&&P.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(P),t.parser.lazy[C.start.line]){let A=i.events.length;for(;A--;)if(i.events[A][1].start.offset<s&&(!i.events[A][1].end||i.events[A][1].end.offset>s))return;const O=t.events.length;let M=O,j,R;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(j){R=t.events[M][1].end;break}j=!0}for(w(r),A=O;A<t.events.length;)t.events[A][1].end={...R},A++;_r(t.events,M+1,0,t.events.slice(O)),t.events.length=A}}function w(C){let N=n.length;for(;N-- >C;){const P=n[N];t.containerState=P[1],P[0].exit.call(t,e)}n.length=C}function E(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function KH(e,t,n){return xt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ml(e){if(e===null||Pt(e)||aa(e))return 1;if(ym(e))return 2}function vm(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const lw={name:"attention",resolveAll:XH,tokenize:QH};function XH(e,t){let n=-1,r,i,o,s,a,u,c,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},p={...e[n][1].start};fN(h,-u),fN(p,u),s={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Vr(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Vr(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=Vr(c,vm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Vr(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,c=Vr(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,_r(e,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function QH(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ml(r);let o;return s;function s(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const c=e.exit("attentionSequence"),f=Ml(u),h=!f||f===2&&i||n.includes(u),p=!i||i===2&&f||n.includes(r);return c._open=!!(o===42?h:h&&(i||!p)),c._close=!!(o===42?p:p&&(f||!h)),t(u)}}function fN(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const JH={name:"autolink",tokenize:eY};function eY(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(m){return er(m)?(e.consume(m),s):m===64?n(m):c(m)}function s(m){return m===43||m===45||m===46||Wn(m)?(r=1,a(m)):c(m)}function a(m){return m===58?(e.consume(m),r=0,u):(m===43||m===45||m===46||Wn(m))&&r++<32?(e.consume(m),a):(r=0,c(m))}function u(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||gp(m)?n(m):(e.consume(m),u)}function c(m){return m===64?(e.consume(m),f):WH(m)?(e.consume(m),c):n(m)}function f(m){return Wn(m)?h(m):n(m)}function h(m){return m===46?(e.consume(m),r=0,f):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):p(m)}function p(m){if((m===45||Wn(m))&&r++<63){const y=m===45?p:h;return e.consume(m),y}return n(m)}}const Md={partial:!0,tokenize:tY};function tY(e,t,n){return r;function r(o){return mt(o)?xt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Ze(o)?t(o):n(o)}}const z2={continuation:{tokenize:rY},exit:iY,name:"blockQuote",tokenize:nY};function nY(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return mt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function rY(e,t,n){const r=this;return i;function i(s){return mt(s)?xt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(z2,t,n)(s)}}function iY(e){e.exit("blockQuote")}const $2={name:"characterEscape",tokenize:oY};function oY(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return HH(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const B2={name:"characterReference",tokenize:sY};function sY(e,t,n){const r=this;let i=0,o,s;return a;function a(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=Wn,f(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=UH,f):(e.enter("characterReferenceValue"),o=7,s=aw,f(h))}function f(h){if(h===59&&i){const p=e.exit("characterReferenceValue");return s===Wn&&!m1(r.sliceSerialize(p))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&i++<o?(e.consume(h),f):n(h)}}const hN={partial:!0,tokenize:lY},pN={concrete:!0,name:"codeFenced",tokenize:aY};function aY(e,t,n){const r=this,i={partial:!0,tokenize:P};let o=0,s=0,a;return u;function u(A){return c(A)}function c(A){const O=r.events[r.events.length-1];return o=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,a=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(A)}function f(A){return A===a?(s++,e.consume(A),f):s<3?n(A):(e.exit("codeFencedFenceSequence"),mt(A)?xt(e,h,"whitespace")(A):h(A))}function h(A){return A===null||Ze(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(hN,x,N)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(A))}function p(A){return A===null||Ze(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(A)):mt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),xt(e,m,"whitespace")(A)):A===96&&A===a?n(A):(e.consume(A),p)}function m(A){return A===null||Ze(A)?h(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(A))}function y(A){return A===null||Ze(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(A)):A===96&&A===a?n(A):(e.consume(A),y)}function x(A){return e.attempt(i,N,k)(A)}function k(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),w}function w(A){return o>0&&mt(A)?xt(e,E,"linePrefix",o+1)(A):E(A)}function E(A){return A===null||Ze(A)?e.check(hN,x,N)(A):(e.enter("codeFlowValue"),C(A))}function C(A){return A===null||Ze(A)?(e.exit("codeFlowValue"),E(A)):(e.consume(A),C)}function N(A){return e.exit("codeFenced"),t(A)}function P(A,O,M){let j=0;return R;function R(Y){return A.enter("lineEnding"),A.consume(Y),A.exit("lineEnding"),$}function $(Y){return A.enter("codeFencedFence"),mt(Y)?xt(A,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):F(Y)}function F(Y){return Y===a?(A.enter("codeFencedFenceSequence"),H(Y)):M(Y)}function H(Y){return Y===a?(j++,A.consume(Y),H):j>=s?(A.exit("codeFencedFenceSequence"),mt(Y)?xt(A,I,"whitespace")(Y):I(Y)):M(Y)}function I(Y){return Y===null||Ze(Y)?(A.exit("codeFencedFence"),O(Y)):M(Y)}}}function lY(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Pv={name:"codeIndented",tokenize:cY},uY={partial:!0,tokenize:dY};function cY(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),xt(e,o,"linePrefix",5)(c)}function o(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?u(c):Ze(c)?e.attempt(uY,s,u)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Ze(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function u(c){return e.exit("codeIndented"),t(c)}}function dY(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ze(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):xt(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):Ze(s)?i(s):n(s)}}const fY={name:"codeText",previous:pY,resolve:hY,tokenize:mY};function hY(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function pY(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function mY(e,t,n){let r=0,i,o;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),a(h)}function a(h){return h===96?(e.consume(h),r++,a):(e.exit("codeTextSequence"),u(h))}function u(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),u):h===96?(o=e.enter("codeTextSequence"),i=0,f(h)):Ze(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||Ze(h)?(e.exit("codeTextData"),u(h)):(e.consume(h),c)}function f(h){return h===96?(e.consume(h),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",c(h))}}class gY{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&nc(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),nc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),nc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);nc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);nc(this.left,n.reverse())}}}function nc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function V2(e){const t={};let n=-1,r,i,o,s,a,u,c;const f=new gY(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,yY(f,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return _r(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!c}function yY(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,u=[],c={};let f,h,p=-1,m=n,y=0,x=0;const k=[x];for(;m;){for(;e.get(++i)[1]!==m;);o.push(i),m._tokenizer||(f=r.sliceStream(m),m.next||f.push(null),h&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=m,m=m.next}for(m=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(x=p+1,k.push(x),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):k.pop(),p=k.length;p--;){const w=a.slice(k[p],k[p+1]),E=o.pop();u.push([E,E+w.length-1]),e.splice(E,2,w)}for(u.reverse(),p=-1;++p<u.length;)c[y+u[p][0]]=y+u[p][1],y+=u[p][1]-u[p][0]-1;return c}const vY={resolve:wY,tokenize:bY},xY={partial:!0,tokenize:kY};function wY(e){return V2(e),e}function bY(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):Ze(a)?e.check(xY,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function kY(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),xt(e,o,"linePrefix")}function o(s){if(s===null||Ze(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function W2(e,t,n,r,i,o,s,a,u){const c=u||Number.POSITIVE_INFINITY;let f=0;return h;function h(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),p):w===null||w===32||w===41||gp(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(w))}function p(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),m(w))}function m(w){return w===62?(e.exit("chunkString"),e.exit(a),p(w)):w===null||w===60||Ze(w)?n(w):(e.consume(w),w===92?y:m)}function y(w){return w===60||w===62||w===92?(e.consume(w),m):m(w)}function x(w){return!f&&(w===null||w===41||Pt(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):f<c&&w===40?(e.consume(w),f++,x):w===41?(e.consume(w),f--,x):w===null||w===32||w===40||gp(w)?n(w):(e.consume(w),w===92?k:x)}function k(w){return w===40||w===41||w===92?(e.consume(w),x):x(w)}}function U2(e,t,n,r,i,o){const s=this;let a=0,u;return c;function c(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(o),f}function f(m){return a>999||m===null||m===91||m===93&&!u||m===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(o),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):Ze(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===null||m===91||m===93||Ze(m)||a++>999?(e.exit("chunkString"),f(m)):(e.consume(m),u||(u=!mt(m)),m===92?p:h)}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,h):h(m)}}function H2(e,t,n,r,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),s=p===40?41:p,u):n(p)}function u(p){return p===s?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),c(p))}function c(p){return p===s?(e.exit(o),u(s)):p===null?n(p):Ze(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),xt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===s||p===null||Ze(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?h:f)}function h(p){return p===s||p===92?(e.consume(p),f):f(p)}}function Nc(e,t){let n;return r;function r(i){return Ze(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):mt(i)?xt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const SY={name:"definition",tokenize:CY},EY={partial:!0,tokenize:_Y};function CY(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),s(m)}function s(m){return U2.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function a(m){return i=ui(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return Pt(m)?Nc(e,c)(m):c(m)}function c(m){return W2(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function f(m){return e.attempt(EY,h,h)(m)}function h(m){return mt(m)?xt(e,p,"whitespace")(m):p(m)}function p(m){return m===null||Ze(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function _Y(e,t,n){return r;function r(a){return Pt(a)?Nc(e,i)(a):n(a)}function i(a){return H2(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return mt(a)?xt(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Ze(a)?t(a):n(a)}}const NY={name:"hardBreakEscape",tokenize:TY};function TY(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ze(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const AY={name:"headingAtx",resolve:PY,tokenize:RY};function PY(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},_r(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function RY(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||Pt(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||Ze(f)?(e.exit("atxHeading"),t(f)):mt(f)?xt(e,a,"whitespace")(f):(e.enter("atxHeadingText"),c(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function c(f){return f===null||f===35||Pt(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),c)}}const MY=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],mN=["pre","script","style","textarea"],DY={concrete:!0,name:"htmlFlow",resolveTo:jY,tokenize:LY},OY={partial:!0,tokenize:zY},IY={partial:!0,tokenize:FY};function jY(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function LY(e,t,n){const r=this;let i,o,s,a,u;return c;function c(D){return f(D)}function f(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),h}function h(D){return D===33?(e.consume(D),p):D===47?(e.consume(D),o=!0,x):D===63?(e.consume(D),i=3,r.interrupt?t:L):er(D)?(e.consume(D),s=String.fromCharCode(D),k):n(D)}function p(D){return D===45?(e.consume(D),i=2,m):D===91?(e.consume(D),i=5,a=0,y):er(D)?(e.consume(D),i=4,r.interrupt?t:L):n(D)}function m(D){return D===45?(e.consume(D),r.interrupt?t:L):n(D)}function y(D){const G="CDATA[";return D===G.charCodeAt(a++)?(e.consume(D),a===G.length?r.interrupt?t:F:y):n(D)}function x(D){return er(D)?(e.consume(D),s=String.fromCharCode(D),k):n(D)}function k(D){if(D===null||D===47||D===62||Pt(D)){const G=D===47,K=s.toLowerCase();return!G&&!o&&mN.includes(K)?(i=1,r.interrupt?t(D):F(D)):MY.includes(s.toLowerCase())?(i=6,G?(e.consume(D),w):r.interrupt?t(D):F(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):o?E(D):C(D))}return D===45||Wn(D)?(e.consume(D),s+=String.fromCharCode(D),k):n(D)}function w(D){return D===62?(e.consume(D),r.interrupt?t:F):n(D)}function E(D){return mt(D)?(e.consume(D),E):R(D)}function C(D){return D===47?(e.consume(D),R):D===58||D===95||er(D)?(e.consume(D),N):mt(D)?(e.consume(D),C):R(D)}function N(D){return D===45||D===46||D===58||D===95||Wn(D)?(e.consume(D),N):P(D)}function P(D){return D===61?(e.consume(D),A):mt(D)?(e.consume(D),P):C(D)}function A(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),u=D,O):mt(D)?(e.consume(D),A):M(D)}function O(D){return D===u?(e.consume(D),u=null,j):D===null||Ze(D)?n(D):(e.consume(D),O)}function M(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Pt(D)?P(D):(e.consume(D),M)}function j(D){return D===47||D===62||mt(D)?C(D):n(D)}function R(D){return D===62?(e.consume(D),$):n(D)}function $(D){return D===null||Ze(D)?F(D):mt(D)?(e.consume(D),$):n(D)}function F(D){return D===45&&i===2?(e.consume(D),q):D===60&&i===1?(e.consume(D),Z):D===62&&i===4?(e.consume(D),U):D===63&&i===3?(e.consume(D),L):D===93&&i===5?(e.consume(D),W):Ze(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(OY,V,H)(D)):D===null||Ze(D)?(e.exit("htmlFlowData"),H(D)):(e.consume(D),F)}function H(D){return e.check(IY,I,V)(D)}function I(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Y}function Y(D){return D===null||Ze(D)?H(D):(e.enter("htmlFlowData"),F(D))}function q(D){return D===45?(e.consume(D),L):F(D)}function Z(D){return D===47?(e.consume(D),s="",B):F(D)}function B(D){if(D===62){const G=s.toLowerCase();return mN.includes(G)?(e.consume(D),U):F(D)}return er(D)&&s.length<8?(e.consume(D),s+=String.fromCharCode(D),B):F(D)}function W(D){return D===93?(e.consume(D),L):F(D)}function L(D){return D===62?(e.consume(D),U):D===45&&i===2?(e.consume(D),L):F(D)}function U(D){return D===null||Ze(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),U)}function V(D){return e.exit("htmlFlow"),t(D)}}function FY(e,t,n){const r=this;return i;function i(s){return Ze(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function zY(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Md,t,n)}}const $Y={name:"htmlText",tokenize:BY};function BY(e,t,n){const r=this;let i,o,s;return a;function a(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),u}function u(L){return L===33?(e.consume(L),c):L===47?(e.consume(L),P):L===63?(e.consume(L),C):er(L)?(e.consume(L),M):n(L)}function c(L){return L===45?(e.consume(L),f):L===91?(e.consume(L),o=0,y):er(L)?(e.consume(L),E):n(L)}function f(L){return L===45?(e.consume(L),m):n(L)}function h(L){return L===null?n(L):L===45?(e.consume(L),p):Ze(L)?(s=h,Z(L)):(e.consume(L),h)}function p(L){return L===45?(e.consume(L),m):h(L)}function m(L){return L===62?q(L):L===45?p(L):h(L)}function y(L){const U="CDATA[";return L===U.charCodeAt(o++)?(e.consume(L),o===U.length?x:y):n(L)}function x(L){return L===null?n(L):L===93?(e.consume(L),k):Ze(L)?(s=x,Z(L)):(e.consume(L),x)}function k(L){return L===93?(e.consume(L),w):x(L)}function w(L){return L===62?q(L):L===93?(e.consume(L),w):x(L)}function E(L){return L===null||L===62?q(L):Ze(L)?(s=E,Z(L)):(e.consume(L),E)}function C(L){return L===null?n(L):L===63?(e.consume(L),N):Ze(L)?(s=C,Z(L)):(e.consume(L),C)}function N(L){return L===62?q(L):C(L)}function P(L){return er(L)?(e.consume(L),A):n(L)}function A(L){return L===45||Wn(L)?(e.consume(L),A):O(L)}function O(L){return Ze(L)?(s=O,Z(L)):mt(L)?(e.consume(L),O):q(L)}function M(L){return L===45||Wn(L)?(e.consume(L),M):L===47||L===62||Pt(L)?j(L):n(L)}function j(L){return L===47?(e.consume(L),q):L===58||L===95||er(L)?(e.consume(L),R):Ze(L)?(s=j,Z(L)):mt(L)?(e.consume(L),j):q(L)}function R(L){return L===45||L===46||L===58||L===95||Wn(L)?(e.consume(L),R):$(L)}function $(L){return L===61?(e.consume(L),F):Ze(L)?(s=$,Z(L)):mt(L)?(e.consume(L),$):j(L)}function F(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),i=L,H):Ze(L)?(s=F,Z(L)):mt(L)?(e.consume(L),F):(e.consume(L),I)}function H(L){return L===i?(e.consume(L),i=void 0,Y):L===null?n(L):Ze(L)?(s=H,Z(L)):(e.consume(L),H)}function I(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||Pt(L)?j(L):(e.consume(L),I)}function Y(L){return L===47||L===62||Pt(L)?j(L):n(L)}function q(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function Z(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),B}function B(L){return mt(L)?xt(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):W(L)}function W(L){return e.enter("htmlTextData"),s(L)}}const g1={name:"labelEnd",resolveAll:HY,resolveTo:YY,tokenize:qY},VY={tokenize:GY},WY={tokenize:ZY},UY={tokenize:KY};function HY(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&_r(e,0,e.length,n),e}function YY(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",u,t],["enter",c,t]],a=Vr(a,e.slice(o+1,o+r+3)),a=Vr(a,[["enter",f,t]]),a=Vr(a,vm(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=Vr(a,[["exit",f,t],e[s-2],e[s-1],["exit",c,t]]),a=Vr(a,e.slice(s+1)),a=Vr(a,[["exit",u,t]]),_r(e,o,e.length,a),e}function qY(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?h(p):(s=r.parser.defined.includes(ui(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):n(p)}function u(p){return p===40?e.attempt(VY,f,s?f:h)(p):p===91?e.attempt(WY,f,s?c:h)(p):s?f(p):h(p)}function c(p){return e.attempt(UY,f,h)(p)}function f(p){return t(p)}function h(p){return o._balanced=!0,n(p)}}function GY(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return Pt(h)?Nc(e,o)(h):o(h)}function o(h){return h===41?f(h):W2(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return Pt(h)?Nc(e,u)(h):f(h)}function a(h){return n(h)}function u(h){return h===34||h===39||h===40?H2(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):f(h)}function c(h){return Pt(h)?Nc(e,f)(h):f(h)}function f(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function ZY(e,t,n){const r=this;return i;function i(a){return U2.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(ui(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function KY(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const XY={name:"labelStartImage",resolveAll:g1.resolveAll,tokenize:QY};function QY(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const JY={name:"labelStartLink",resolveAll:g1.resolveAll,tokenize:eq};function eq(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Rv={name:"lineEnding",tokenize:tq};function tq(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),xt(e,t,"linePrefix")}}const Gh={name:"thematicBreak",tokenize:nq};function nq(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||Ze(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),mt(c)?xt(e,a,"whitespace")(c):a(c))}}const ur={continuation:{tokenize:sq},exit:lq,name:"list",tokenize:oq},rq={partial:!0,tokenize:uq},iq={partial:!0,tokenize:aq};function oq(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(m){const y=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:aw(m)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Gh,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return aw(m)&&++s<10?(e.consume(m),u):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Md,r.interrupt?n:f,e.attempt(rq,p,h))}function f(m){return r.containerState.initialBlankLine=!0,o++,p(m)}function h(m){return mt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function sq(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Md,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,xt(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!mt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(iq,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,xt(e,e.attempt(ur,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function aq(e,t,n){const r=this;return xt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function lq(e){e.exit(this.containerState.type)}function uq(e,t,n){const r=this;return xt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!mt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const gN={name:"setextUnderline",resolveTo:cq,tokenize:dq};function cq(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function dq(e,t,n){const r=this;let i;return o;function o(c){let f=r.events.length,h;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){h=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),mt(c)?xt(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||Ze(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const fq={tokenize:hq};function hq(e){const t=this,n=e.attempt(Md,r,e.attempt(this.parser.constructs.flowInitial,i,xt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(vY,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const pq={resolveAll:q2()},mq=Y2("string"),gq=Y2("text");function Y2(e){return{resolveAll:q2(e==="text"?yq:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(f){return c(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return c(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function c(f){if(f===null)return!0;const h=i[f];let p=-1;if(h)for(;++p<h.length;){const m=h[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function q2(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function yq(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,u;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)u=!0,a++;else if(c!==-1){o++;break}}if(a){const c={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const vq={42:ur,43:ur,45:ur,48:ur,49:ur,50:ur,51:ur,52:ur,53:ur,54:ur,55:ur,56:ur,57:ur,62:z2},xq={91:SY},wq={[-2]:Pv,[-1]:Pv,32:Pv},bq={35:AY,42:Gh,45:[gN,Gh],60:DY,61:gN,95:Gh,96:pN,126:pN},kq={38:B2,92:$2},Sq={[-5]:Rv,[-4]:Rv,[-3]:Rv,33:XY,38:B2,42:lw,60:[JH,$Y],91:JY,92:[NY,$2],93:g1,95:lw,96:fY},Eq={null:[lw,pq]},Cq={null:[42,95]},_q={null:[]},Nq=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Cq,contentInitial:xq,disable:_q,document:vq,flow:bq,flowInitial:wq,insideSpan:Eq,string:kq,text:Sq},Symbol.toStringTag,{value:"Module"}));function Tq(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const u={attempt:O(P),check:O(A),consume:E,enter:C,exit:N,interrupt:O(A,{interrupt:!0})},c={code:null,containerState:{},defineSkip:x,events:[],now:y,parser:e,previous:null,sliceSerialize:p,sliceStream:m,write:h};let f=t.tokenize.call(c,u);return t.resolveAll&&o.push(t),c;function h($){return s=Vr(s,$),k(),s[s.length-1]!==null?[]:(M(t,0),c.events=vm(o,c.events,c),c.events)}function p($,F){return Pq(m($),F)}function m($){return Aq(s,$)}function y(){const{_bufferIndex:$,_index:F,line:H,column:I,offset:Y}=r;return{_bufferIndex:$,_index:F,line:H,column:I,offset:Y}}function x($){i[$.line]=$.column,R()}function k(){let $;for(;r._index<s.length;){const F=s[r._index];if(typeof F=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<F.length;)w(F.charCodeAt(r._bufferIndex));else w(F)}}function w($){f=f($)}function E($){Ze($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,R()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=$}function C($,F){const H=F||{};return H.type=$,H.start=y(),c.events.push(["enter",H,c]),a.push(H),H}function N($){const F=a.pop();return F.end=y(),c.events.push(["exit",F,c]),F}function P($,F){M($,F.from)}function A($,F){F.restore()}function O($,F){return H;function H(I,Y,q){let Z,B,W,L;return Array.isArray(I)?V(I):"tokenize"in I?V([I]):U(I);function U(J){return ee;function ee(re){const ue=re!==null&&J[re],he=re!==null&&J.null,be=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(he)?he:he?[he]:[]];return V(be)(re)}}function V(J){return Z=J,B=0,J.length===0?q:D(J[B])}function D(J){return ee;function ee(re){return L=j(),W=J,J.partial||(c.currentConstruct=J),J.name&&c.parser.constructs.disable.null.includes(J.name)?K():J.tokenize.call(F?Object.assign(Object.create(c),F):c,u,G,K)(re)}}function G(J){return $(W,L),Y}function K(J){return L.restore(),++B<Z.length?D(Z[B]):q}}}function M($,F){$.resolveAll&&!o.includes($)&&o.push($),$.resolve&&_r(c.events,F,c.events.length-F,$.resolve(c.events.slice(F),c)),$.resolveTo&&(c.events=$.resolveTo(c.events,c))}function j(){const $=y(),F=c.previous,H=c.currentConstruct,I=c.events.length,Y=Array.from(a);return{from:I,restore:q};function q(){r=$,c.previous=F,c.currentConstruct=H,c.events.length=I,a=Y,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Aq(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Pq(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
210
+ `;break}case-3:{s=`\r
211
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function Rq(e){const r={constructs:L2([Nq,...(e||{}).extensions||[]]),content:i(YH),defined:[],document:i(GH),flow:i(fq),lazy:{},string:i(mq),text:i(gq)};return r;function i(o){return s;function s(a){return Tq(r,o,a)}}}function Mq(e){for(;!V2(e););return e}const yN=/[\0\t\n\r]/g;function Dq(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const u=[];let c,f,h,p,m;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h<o.length;){if(yN.lastIndex=h,c=yN.exec(o),p=c&&c.index!==void 0?c.index:o.length,m=o.charCodeAt(p),!c){t=o.slice(h);break}if(m===10&&h===p&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),h<p&&(u.push(o.slice(h,p)),e+=p-h),m){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const Oq=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Iq(e){return e.replace(Oq,jq)}function jq(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return F2(n.slice(o?2:1),o?16:10)}return m1(n)||e}const G2={}.hasOwnProperty;function Lq(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Fq(n)(Mq(Rq(n).document().write(Dq()(e,t,!0))))}function Fq(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(oe),autolinkProtocol:j,autolinkEmail:j,atxHeading:o($e),blockQuote:o(he),characterEscape:j,characterReference:j,codeFenced:o(be),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(be,s),codeText:o(fe,s),codeTextData:j,data:j,codeFlowValue:j,definition:o(ve),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Me),hardBreakEscape:o(ct),hardBreakTrailing:o(ct),htmlFlow:o(_t,s),htmlFlowData:j,htmlText:o(_t,s),htmlTextData:j,image:o(Q),label:s,link:o(oe),listItem:o(Ce),listItemValue:p,listOrdered:o(ae,h),listUnordered:o(ae),paragraph:o(ke),reference:D,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o($e),strong:o(ge),thematicBreak:o(Fe)},exit:{atxHeading:u(),atxHeadingSequence:P,autolink:u(),autolinkEmail:ue,autolinkProtocol:re,blockQuote:u(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:J,characterReference:ee,codeFenced:u(k),codeFencedFence:x,codeFencedFenceInfo:m,codeFencedFenceMeta:y,codeFlowValue:R,codeIndented:u(w),codeText:u(Y),codeTextData:R,data:R,definition:u(),definitionDestinationString:N,definitionLabelString:E,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(F),hardBreakTrailing:u(F),htmlFlow:u(H),htmlFlowData:R,htmlText:u(I),htmlTextData:R,image:u(Z),label:W,labelText:B,lineEnding:$,link:u(q),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:G,resourceDestinationString:L,resourceTitleString:U,resource:V,setextHeading:u(M),setextHeadingLineSequence:O,setextHeadingText:A,strong:u(),thematicBreak:u()}};Z2(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ce){let pe={type:"root",children:[]};const Ie={stack:[pe],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:f,data:n},Ke=[];let tt=-1;for(;++tt<ce.length;)if(ce[tt][1].type==="listOrdered"||ce[tt][1].type==="listUnordered")if(ce[tt][0]==="enter")Ke.push(tt);else{const At=Ke.pop();tt=i(ce,At,tt)}for(tt=-1;++tt<ce.length;){const At=t[ce[tt][0]];G2.call(At,ce[tt][1].type)&&At[ce[tt][1].type].call(Object.assign({sliceSerialize:ce[tt][2].sliceSerialize},Ie),ce[tt][1])}if(Ie.tokenStack.length>0){const At=Ie.tokenStack[Ie.tokenStack.length-1];(At[1]||vN).call(Ie,void 0,At[0])}for(pe.position={start:Jo(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:Jo(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},tt=-1;++tt<t.transforms.length;)pe=t.transforms[tt](pe)||pe;return pe}function i(ce,pe,Ie){let Ke=pe-1,tt=-1,At=!1,He,it,at,Wt;for(;++Ke<=Ie;){const yt=ce[Ke];switch(yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yt[0]==="enter"?tt++:tt--,Wt=void 0;break}case"lineEndingBlank":{yt[0]==="enter"&&(He&&!Wt&&!tt&&!at&&(at=Ke),Wt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Wt=void 0}if(!tt&&yt[0]==="enter"&&yt[1].type==="listItemPrefix"||tt===-1&&yt[0]==="exit"&&(yt[1].type==="listUnordered"||yt[1].type==="listOrdered")){if(He){let yn=Ke;for(it=void 0;yn--;){const gt=ce[yn];if(gt[1].type==="lineEnding"||gt[1].type==="lineEndingBlank"){if(gt[0]==="exit")continue;it&&(ce[it][1].type="lineEndingBlank",At=!0),gt[1].type="lineEnding",it=yn}else if(!(gt[1].type==="linePrefix"||gt[1].type==="blockQuotePrefix"||gt[1].type==="blockQuotePrefixWhitespace"||gt[1].type==="blockQuoteMarker"||gt[1].type==="listItemIndent"))break}at&&(!it||at<it)&&(He._spread=!0),He.end=Object.assign({},it?ce[it][1].start:yt[1].end),ce.splice(it||Ke,0,["exit",He,yt[2]]),Ke++,Ie++}if(yt[1].type==="listItemPrefix"){const yn={type:"listItem",_spread:!1,start:Object.assign({},yt[1].start),end:void 0};He=yn,ce.splice(Ke,0,["enter",yn,yt[2]]),Ke++,Ie++,at=void 0,Wt=!0}}}return ce[pe][1]._spread=At,Ie}function o(ce,pe){return Ie;function Ie(Ke){a.call(this,ce(Ke),Ke),pe&&pe.call(this,Ke)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(ce,pe,Ie){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([pe,Ie||void 0]),ce.position={start:Jo(pe.start),end:void 0}}function u(ce){return pe;function pe(Ie){ce&&ce.call(this,Ie),c.call(this,Ie)}}function c(ce,pe){const Ie=this.stack.pop(),Ke=this.tokenStack.pop();if(Ke)Ke[0].type!==ce.type&&(pe?pe.call(this,ce,Ke[0]):(Ke[1]||vN).call(this,ce,Ke[0]));else throw new Error("Cannot close `"+ce.type+"` ("+_c({start:ce.start,end:ce.end})+"): it’s not open");Ie.position.end=Jo(ce.end)}function f(){return p1(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(ce){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function m(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=ce}function y(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=ce}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ce.replace(/(\r?\n|\r)$/g,"")}function E(ce){const pe=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=pe,Ie.identifier=ui(this.sliceSerialize(ce)).toLowerCase()}function C(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ce}function N(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ce}function P(ce){const pe=this.stack[this.stack.length-1];if(!pe.depth){const Ie=this.sliceSerialize(ce).length;pe.depth=Ie}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function O(ce){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function j(ce){const Ie=this.stack[this.stack.length-1].children;let Ke=Ie[Ie.length-1];(!Ke||Ke.type!=="text")&&(Ke=Ae(),Ke.position={start:Jo(ce.start),end:void 0},Ie.push(Ke)),this.stack.push(Ke)}function R(ce){const pe=this.stack.pop();pe.value+=this.sliceSerialize(ce),pe.position.end=Jo(ce.end)}function $(ce){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ie=pe.children[pe.children.length-1];Ie.position.end=Jo(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(pe.type)&&(j.call(this,ce),R.call(this,ce))}function F(){this.data.atHardBreak=!0}function H(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ce}function I(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ce}function Y(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.value=ce}function q(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=pe,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function Z(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=pe,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function B(ce){const pe=this.sliceSerialize(ce),Ie=this.stack[this.stack.length-2];Ie.label=Iq(pe),Ie.identifier=ui(pe).toLowerCase()}function W(){const ce=this.stack[this.stack.length-1],pe=this.resume(),Ie=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ie.type==="link"){const Ke=ce.children;Ie.children=Ke}else Ie.alt=pe}function L(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.url=ce}function U(){const ce=this.resume(),pe=this.stack[this.stack.length-1];pe.title=ce}function V(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function G(ce){const pe=this.resume(),Ie=this.stack[this.stack.length-1];Ie.label=pe,Ie.identifier=ui(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function K(ce){this.data.characterReferenceType=ce.type}function J(ce){const pe=this.sliceSerialize(ce),Ie=this.data.characterReferenceType;let Ke;Ie?(Ke=F2(pe,Ie==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ke=m1(pe);const tt=this.stack[this.stack.length-1];tt.value+=Ke}function ee(ce){const pe=this.stack.pop();pe.position.end=Jo(ce.end)}function re(ce){R.call(this,ce);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(ce)}function ue(ce){R.call(this,ce);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(ce)}function he(){return{type:"blockquote",children:[]}}function be(){return{type:"code",lang:null,meta:null,value:""}}function fe(){return{type:"inlineCode",value:""}}function ve(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Me(){return{type:"emphasis",children:[]}}function $e(){return{type:"heading",depth:0,children:[]}}function ct(){return{type:"break"}}function _t(){return{type:"html",value:""}}function Q(){return{type:"image",title:null,url:"",alt:null}}function oe(){return{type:"link",title:null,url:"",children:[]}}function ae(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function Ce(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function ke(){return{type:"paragraph",children:[]}}function ge(){return{type:"strong",children:[]}}function Ae(){return{type:"text",value:""}}function Fe(){return{type:"thematicBreak"}}}function Jo(e){return{line:e.line,column:e.column,offset:e.offset}}function Z2(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Z2(e,r):zq(e,r)}}function zq(e,t){let n;for(n in t)if(G2.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function vN(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_c({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_c({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_c({start:t.start,end:t.end})+") is still open")}function $q(e){const t=this;t.parser=n;function n(r){return Lq(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Bq(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Vq(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
212
+ `}]}function Wq(e,t){const n=t.value?t.value+`
213
+ `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function Uq(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hq(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yq(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=ou(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function qq(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Gq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function K2(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Zq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return K2(e,t);const i={src:ou(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function Kq(e,t){const n={src:ou(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Xq(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Qq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return K2(e,t);const i={href:ou(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Jq(e,t){const n={href:ou(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function eG(e,t,n){const r=e.all(t),i=n?tG(n):X2(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let h;f&&f.type==="element"&&f.tagName==="p"?h=f:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
214
+ `}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
215
+ `});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)}function tG(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=X2(n[r])}return t}function X2(e){const t=e.spread;return t??e.children.length>1}function nG(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function rG(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iG(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function oG(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sG(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=c1(t.children[1]),u=P2(t.children[t.children.length-1]);a&&u&&(s.position={start:a,end:u}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function aG(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let u=-1;const c=[];for(;++u<a;){const h=t.children[u],p={},m=s?s[u]:void 0;m&&(p.align=m);let y={type:"element",tagName:o,properties:p,children:[]};h&&(y.children=e.all(h),e.patch(h,y),y=e.applyData(h,y)),c.push(y)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,f),e.applyData(t,f)}function lG(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const xN=9,wN=32;function uG(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(bN(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(bN(t.slice(i),i>0,!1)),o.join("")}function bN(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===xN||o===wN;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===xN||o===wN;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function cG(e,t){const n={type:"text",value:uG(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function dG(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const fG={blockquote:Bq,break:Vq,code:Wq,delete:Uq,emphasis:Hq,footnoteReference:Yq,heading:qq,html:Gq,imageReference:Zq,image:Kq,inlineCode:Xq,linkReference:Qq,link:Jq,listItem:eG,list:nG,paragraph:rG,root:iG,strong:oG,table:sG,tableCell:lG,tableRow:aG,text:cG,thematicBreak:dG,toml:Eh,yaml:Eh,definition:Eh,footnoteDefinition:Eh};function Eh(){}const Q2=-1,xm=0,yp=1,vp=2,y1=3,v1=4,x1=5,w1=6,J2=7,eD=8,kN=typeof self=="object"?self:globalThis,hG=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case xm:case Q2:return n(s,i);case yp:{const a=n([],i);for(const u of s)a.push(r(u));return a}case vp:{const a=n({},i);for(const[u,c]of s)a[r(u)]=r(c);return a}case y1:return n(new Date(s),i);case v1:{const{source:a,flags:u}=s;return n(new RegExp(a,u),i)}case x1:{const a=n(new Map,i);for(const[u,c]of s)a.set(r(u),r(c));return a}case w1:{const a=n(new Set,i);for(const u of s)a.add(r(u));return a}case J2:{const{name:a,message:u}=s;return n(new kN[a](u),i)}case eD:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new kN[o](s),i)};return r},SN=e=>hG(new Map,e)(0),Ja="",{toString:pG}={},{keys:mG}=Object,rc=e=>{const t=typeof e;if(t!=="object"||!e)return[xm,t];const n=pG.call(e).slice(8,-1);switch(n){case"Array":return[yp,Ja];case"Object":return[vp,Ja];case"Date":return[y1,Ja];case"RegExp":return[v1,Ja];case"Map":return[x1,Ja];case"Set":return[w1,Ja]}return n.includes("Array")?[yp,n]:n.includes("Error")?[J2,n]:[vp,n]},Ch=([e,t])=>e===xm&&(t==="function"||t==="symbol"),gG=(e,t,n,r)=>{const i=(s,a)=>{const u=r.push(s)-1;return n.set(a,u),u},o=s=>{if(n.has(s))return n.get(s);let[a,u]=rc(s);switch(a){case xm:{let f=s;switch(u){case"bigint":a=eD,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([Q2],s)}return i([a,f],s)}case yp:{if(u)return i([u,[...s]],s);const f=[],h=i([a,f],s);for(const p of s)f.push(o(p));return h}case vp:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],h=i([a,f],s);for(const p of mG(s))(e||!Ch(rc(s[p])))&&f.push([o(p),o(s[p])]);return h}case y1:return i([a,s.toISOString()],s);case v1:{const{source:f,flags:h}=s;return i([a,{source:f,flags:h}],s)}case x1:{const f=[],h=i([a,f],s);for(const[p,m]of s)(e||!(Ch(rc(p))||Ch(rc(m))))&&f.push([o(p),o(m)]);return h}case w1:{const f=[],h=i([a,f],s);for(const p of s)(e||!Ch(rc(p)))&&f.push(o(p));return h}}const{message:c}=s;return i([a,{name:u,message:c}],s)};return o},EN=(e,{json:t,lossy:n}={})=>{const r=[];return gG(!(t||n),!!t,new Map,r)(e),r},xp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?SN(EN(e,t)):structuredClone(e):(e,t)=>SN(EN(e,t));function yG(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function vG(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function xG(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||yG,r=e.options.footnoteBackLabel||vG,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[u]);if(!c)continue;const f=e.all(c),h=String(c.identifier).toUpperCase(),p=ou(h.toLowerCase());let m=0;const y=[],x=e.footnoteCounts.get(h);for(;x!==void 0&&++m<=x;){y.length>0&&y.push({type:"text",value:" "});let E=typeof n=="string"?n:n(u,m);typeof E=="string"&&(E={type:"text",value:E}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,m),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const k=f[f.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const E=k.children[k.children.length-1];E&&E.type==="text"?E.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...y)}else f.push(...y);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(c,w),a.push(w)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...xp(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
216
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
217
+ `}]}}const wm=function(e){if(e==null)return SG;if(typeof e=="function")return bm(e);if(typeof e=="object")return Array.isArray(e)?wG(e):bG(e);if(typeof e=="string")return kG(e);throw new Error("Expected function, string, or object as test")};function wG(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=wm(e[n]);return bm(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function bG(e){const t=e;return bm(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function kG(e){return bm(t);function t(n){return n&&n.type===e}}function bm(e){return t;function t(n,r,i){return!!(EG(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function SG(){return!0}function EG(e){return e!==null&&typeof e=="object"&&"type"in e}const tD=[],CG=!0,uw=!1,_G="skip";function nD(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=wm(i),s=r?-1:1;a(e,void 0,[])();function a(u,c,f){const h=u&&typeof u=="object"?u:{};if(typeof h.type=="string"){const m=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(u.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=tD,y,x,k;if((!t||o(u,c,f[f.length-1]||void 0))&&(m=NG(n(u,f)),m[0]===uw))return m;if("children"in u&&u.children){const w=u;if(w.children&&m[0]!==_G)for(x=(r?w.children.length:-1)+s,k=f.concat(w);x>-1&&x<w.children.length;){const E=w.children[x];if(y=a(E,x,k)(),y[0]===uw)return y;x=typeof y[1]=="number"?y[1]:x+s}}return m}}}function NG(e){return Array.isArray(e)?e:typeof e=="number"?[CG,e]:e==null?tD:[e]}function b1(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),nD(e,o,a,i);function a(u,c){const f=c[c.length-1],h=f?f.children.indexOf(u):void 0;return s(u,h,f)}}const cw={}.hasOwnProperty,TG={};function AG(e,t){const n=t||TG,r=new Map,i=new Map,o=new Map,s={...fG,...n.handlers},a={all:c,applyData:RG,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:u,options:n,patch:PG,wrap:DG};return b1(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const h=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();h.has(p)||h.set(p,f)}}),a;function u(f,h){const p=f.type,m=a.handlers[p];if(cw.call(a.handlers,p)&&m)return m(a,f,h);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in f){const{children:x,...k}=f,w=xp(k);return w.children=a.all(f),w}return xp(f)}return(a.options.unknownHandler||MG)(a,f,h)}function c(f){const h=[];if("children"in f){const p=f.children;let m=-1;for(;++m<p.length;){const y=a.one(p[m],f);if(y){if(m&&p[m-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=CN(y.value)),!Array.isArray(y)&&y.type==="element")){const x=y.children[0];x&&x.type==="text"&&(x.value=CN(x.value))}Array.isArray(y)?h.push(...y):h.push(y)}}}return h}}function PG(e,t){e.position&&(t.position=gH(e))}function RG(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,xp(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function MG(e,t){const n=t.data||{},r="value"in t&&!(cw.call(n,"hProperties")||cw.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function DG(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
218
+ `});++r<e.length;)r&&n.push({type:"text",value:`
219
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
220
+ `}),n}function CN(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _N(e,t){const n=AG(e,t),r=n.one(e,void 0),i=xG(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
221
+ `},i),o}function OG(e,t){return e&&"run"in e?async function(n,r){const i=_N(n,{file:r,...t});await e.run(i,r)}:function(n,r){return _N(n,{file:r,...e||t})}}function NN(e){if(e)throw e}var Mv,TN;function IG(){if(TN)return Mv;TN=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},o=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var f=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!f&&!h)return!1;var p;for(p in c);return typeof p>"u"||e.call(c,p)},s=function(c,f){n&&f.name==="__proto__"?n(c,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):c[f.name]=f.newValue},a=function(c,f){if(f==="__proto__")if(e.call(c,f)){if(r)return r(c,f).value}else return;return c[f]};return Mv=function u(){var c,f,h,p,m,y,x=arguments[0],k=1,w=arguments.length,E=!1;for(typeof x=="boolean"&&(E=x,x=arguments[1]||{},k=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});k<w;++k)if(c=arguments[k],c!=null)for(f in c)h=a(x,f),p=a(c,f),x!==p&&(E&&p&&(o(p)||(m=i(p)))?(m?(m=!1,y=h&&i(h)?h:[]):y=h&&o(h)?h:{},s(x,{name:f,newValue:u(E,y,p)})):typeof p<"u"&&s(x,{name:f,newValue:p}));return x},Mv}var jG=IG();const Dv=Zl(jG);function dw(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function LG(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...c){const f=e[++o];let h=-1;if(u){s(u);return}for(;++h<i.length;)(c[h]===null||c[h]===void 0)&&(c[h]=i[h]);i=c,f?FG(f,a)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function FG(e,t){let n;return r;function r(...s){const a=e.length>s.length;let u;a&&s.push(i);try{u=e.apply(this,s)}catch(c){const f=c;if(a&&n)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Ei={basename:zG,dirname:$G,extname:BG,join:VG,sep:"/"};function zG(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Dd(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function $G(e){if(Dd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function BG(e){Dd(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function VG(...e){let t=-1,n;for(;++t<e.length;)Dd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":WG(n)}function WG(e){Dd(e);const t=e.codePointAt(0)===47;let n=UG(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function UG(e,t){let n="",r=0,i=-1,o=0,s=-1,a,u;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function Dd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const HG={cwd:YG};function YG(){return"/"}function fw(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function qG(e){if(typeof e=="string")e=new URL(e);else if(!fw(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return GG(e)}function GG(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Ov=["history","path","basename","stem","extname","dirname"];class rD{constructor(t){let n;t?fw(t)?n={path:t}:typeof t=="string"||ZG(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":HG.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ov.length;){const o=Ov[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Ov.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ei.basename(this.path):void 0}set basename(t){jv(t,"basename"),Iv(t,"basename"),this.path=Ei.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ei.dirname(this.path):void 0}set dirname(t){AN(this.basename,"dirname"),this.path=Ei.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ei.extname(this.path):void 0}set extname(t){if(Iv(t,"extname"),AN(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ei.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){fw(t)&&(t=qG(t)),jv(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ei.basename(this.path,this.extname):void 0}set stem(t){jv(t,"stem"),Iv(t,"stem"),this.path=Ei.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Yn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Iv(e,t){if(e&&e.includes(Ei.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ei.sep+"`")}function jv(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function AN(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ZG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const KG=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},XG={}.hasOwnProperty;class k1 extends KG{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=LG()}copy(){const t=new k1;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Dv(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(zv("data",this.frozen),this.namespace[t]=n,this):XG.call(this.namespace,t)&&this.namespace[t]||void 0:t?(zv("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=_h(t),r=this.parser||this.Parser;return Lv("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Lv("process",this.parser||this.Parser),Fv("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=_h(t),u=r.parse(a);r.run(u,a,function(f,h,p){if(f||!h||!p)return c(f);const m=h,y=r.stringify(m,p);eZ(y)?p.value=y:p.result=y,c(f,p)});function c(f,h){f||!h?s(f):o?o(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Lv("processSync",this.parser||this.Parser),Fv("processSync",this.compiler||this.Compiler),this.process(t,i),RN("processSync","process",n),r;function i(o,s){n=!0,NN(o),r=s}}run(t,n,r){PN(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const u=_h(n);i.run(t,u,c);function c(f,h,p){const m=h||t;f?a(f):s?s(m):r(void 0,m,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),RN("runSync","run",r),i;function o(s,a){NN(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=_h(n),i=this.compiler||this.Compiler;return Fv("stringify",i),PN(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(zv("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[f,...h]=c;u(f,h)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=Dv(!0,i.settings,c.settings))}function a(c){let f=-1;if(c!=null)if(Array.isArray(c))for(;++f<c.length;){const h=c[f];o(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,f){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===c){p=h;break}if(p===-1)r.push([c,...f]);else if(f.length>0){let[m,...y]=f;const x=r[p][1];dw(x)&&dw(m)&&(m=Dv(!0,x,m)),r[p]=[c,m,...y]}}}}const QG=new k1().freeze();function Lv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Fv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function zv(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function PN(e){if(!dw(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function RN(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function _h(e){return JG(e)?e:new rD(e)}function JG(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function eZ(e){return typeof e=="string"||tZ(e)}function tZ(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nZ="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",MN=[],DN={allowDangerousHtml:!0},rZ=/^(https?|ircs?|mailto|xmpp)$/i,iZ=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function oZ(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||MN,u=e.remarkPlugins||MN,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...DN}:DN,f=e.skipHtml,h=e.unwrapDisallowed,p=e.urlTransform||sZ,m=QG().use($q).use(u).use(OG,c).use(a),y=new rD;typeof r=="string"&&(y.value=r);for(const E of iZ)Object.hasOwn(e,E.from)&&(""+E.from+(E.to?"use `"+E.to+"` instead":"remove it")+nZ+E.id,void 0);const x=m.parse(y);let k=m.runSync(x,y);return i&&(k={type:"element",tagName:"div",properties:{className:i},children:k.type==="root"?k.children:[k]}),b1(k,w),kH(k,{Fragment:v.Fragment,components:o,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function w(E,C,N){if(E.type==="raw"&&N&&typeof C=="number")return f?N.children.splice(C,1):N.children[C]={type:"text",value:E.value},C;if(E.type==="element"){let P;for(P in Av)if(Object.hasOwn(Av,P)&&Object.hasOwn(E.properties,P)){const A=E.properties[P],O=Av[P];(O===null||O.includes(E.tagName))&&(E.properties[P]=p(String(A||""),P,E))}}if(E.type==="element"){let P=t?!t.includes(E.tagName):s?s.includes(E.tagName):!1;if(!P&&n&&typeof C=="number"&&(P=!n(E,C,N)),P&&N&&typeof C=="number")return h&&E.children?N.children.splice(C,1,...E.children):N.children.splice(C,1),C}}}function sZ(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||rZ.test(e.slice(0,t))?e:""}function ON(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function aZ(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function lZ(e,t,n){const i=wm(n.ignore||[]),o=uZ(t);let s=-1;for(;++s<o.length;)nD(e,"text",a);function a(c,f){let h=-1,p;for(;++h<f.length;){const m=f[h],y=p?p.children:void 0;if(i(m,y?y.indexOf(m):void 0,p))return;p=m}if(p)return u(c,f)}function u(c,f){const h=f[f.length-1],p=o[s][0],m=o[s][1];let y=0;const k=h.children.indexOf(c);let w=!1,E=[];p.lastIndex=0;let C=p.exec(c.value);for(;C;){const N=C.index,P={index:C.index,input:C.input,stack:[...f,c]};let A=m(...C,P);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?p.lastIndex=N+1:(y!==N&&E.push({type:"text",value:c.value.slice(y,N)}),Array.isArray(A)?E.push(...A):A&&E.push(A),y=N+C[0].length,w=!0),!p.global)break;C=p.exec(c.value)}return w?(y<c.value.length&&E.push({type:"text",value:c.value.slice(y)}),h.children.splice(k,1,...E)):E=[c],k+E.length}}function uZ(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([cZ(i[0]),dZ(i[1])])}return t}function cZ(e){return typeof e=="string"?new RegExp(aZ(e),"g"):e}function dZ(e){return typeof e=="function"?e:function(){return e}}const $v="phrasing",Bv=["autolink","link","image","label"];function fZ(){return{transforms:[xZ],enter:{literalAutolink:pZ,literalAutolinkEmail:Vv,literalAutolinkHttp:Vv,literalAutolinkWww:Vv},exit:{literalAutolink:vZ,literalAutolinkEmail:yZ,literalAutolinkHttp:mZ,literalAutolinkWww:gZ}}}function hZ(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:$v,notInConstruct:Bv},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:$v,notInConstruct:Bv},{character:":",before:"[ps]",after:"\\/",inConstruct:$v,notInConstruct:Bv}]}}function pZ(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Vv(e){this.config.enter.autolinkProtocol.call(this,e)}function mZ(e){this.config.exit.autolinkProtocol.call(this,e)}function gZ(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function yZ(e){this.config.exit.autolinkEmail.call(this,e)}function vZ(e){this.exit(e)}function xZ(e){lZ(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wZ],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),bZ]],{ignore:["link","linkReference"]})}function wZ(e,t,n,r,i){let o="";if(!iD(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!kZ(n)))return!1;const s=SZ(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function bZ(e,t,n,r){return!iD(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function kZ(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function SZ(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=ON(e,"(");let o=ON(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function iD(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||aa(n)||ym(n))&&(!t||n!==47)}oD.peek=OZ;function EZ(){return{enter:{gfmFootnoteDefinition:_Z,gfmFootnoteDefinitionLabelString:NZ,gfmFootnoteCall:PZ,gfmFootnoteCallString:RZ},exit:{gfmFootnoteDefinition:AZ,gfmFootnoteDefinitionLabelString:TZ,gfmFootnoteCall:DZ,gfmFootnoteCallString:MZ}}}function CZ(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:IZ,footnoteReference:oD}}}function _Z(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function NZ(){this.buffer()}function TZ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=ui(this.sliceSerialize(e)).toLowerCase()}function AZ(e){this.exit(e)}function PZ(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function RZ(){this.buffer()}function MZ(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=ui(this.sliceSerialize(e)).toLowerCase()}function DZ(e){this.exit(e)}function oD(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{...i.current(),before:o,after:"]"})),a(),s(),o+=i.move("]"),o}function OZ(){return"["}function IZ(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteDefinition"),a=n.enter("label");return o+=i.move(n.safe(n.associationId(e),{...i.current(),before:o,after:"]"})),a(),o+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),o+=i.move(n.indentLines(n.containerFlow(e,i.current()),jZ)),s(),o}function jZ(e,t,n){return t===0?e:(n?"":" ")+e}const LZ=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];sD.peek=VZ;function FZ(){return{canContainEols:["delete"],enter:{strikethrough:$Z},exit:{strikethrough:BZ}}}function zZ(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:LZ}],handlers:{delete:sD}}}function $Z(e){this.enter({type:"delete",children:[]},e)}function BZ(e){this.exit(e)}function sD(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function VZ(){return"~"}function WZ(e){return e.length}function UZ(e,t){const n=t,r=(n.align||[]).concat(),i=n.stringLength||WZ,o=[],s=[],a=[],u=[];let c=0,f=-1;for(;++f<e.length;){const x=[],k=[];let w=-1;for(e[f].length>c&&(c=e[f].length);++w<e[f].length;){const E=HZ(e[f][w]);if(n.alignDelimiters!==!1){const C=i(E);k[w]=C,(u[w]===void 0||C>u[w])&&(u[w]=C)}x.push(E)}s[f]=x,a[f]=k}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<c;)o[h]=IN(r[h]);else{const x=IN(r);for(;++h<c;)o[h]=x}h=-1;const p=[],m=[];for(;++h<c;){const x=o[h];let k="",w="";x===99?(k=":",w=":"):x===108?k=":":x===114&&(w=":");let E=n.alignDelimiters===!1?1:Math.max(1,u[h]-k.length-w.length);const C=k+"-".repeat(E)+w;n.alignDelimiters!==!1&&(E=k.length+E+w.length,E>u[h]&&(u[h]=E),m[h]=E),p[h]=C}s.splice(1,0,p),a.splice(1,0,m),f=-1;const y=[];for(;++f<s.length;){const x=s[f],k=a[f];h=-1;const w=[];for(;++h<c;){const E=x[h]||"";let C="",N="";if(n.alignDelimiters!==!1){const P=u[h]-(k[h]||0),A=o[h];A===114?C=" ".repeat(P):A===99?P%2?(C=" ".repeat(P/2+.5),N=" ".repeat(P/2-.5)):(C=" ".repeat(P/2),N=C):N=" ".repeat(P)}n.delimiterStart!==!1&&!h&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||h)&&w.push(" "),n.alignDelimiters!==!1&&w.push(C),w.push(E),n.alignDelimiters!==!1&&w.push(N),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||h!==c-1)&&w.push("|")}y.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return y.join(`
222
+ `)}function HZ(e){return e==null?"":String(e)}function IN(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function YZ(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),qZ);return i(),s}function qZ(e,t,n){return">"+(n?"":" ")+e}function GZ(e,t){return jN(e,t.inConstruct,!0)&&!jN(e,t.notInConstruct,!1)}function jN(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function LN(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
223
+ `&&GZ(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
224
+ `}function ZZ(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function KZ(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function XZ(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function QZ(e,t,n,r){const i=XZ(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(KZ(e,n)){const h=n.enter("codeIndented"),p=n.indentLines(o,JZ);return h(),p}const a=n.createTracker(r),u=i.repeat(Math.max(ZZ(o,i)+1,3)),c=n.enter("codeFenced");let f=a.move(u);if(e.lang){const h=n.enter(`codeFencedLang${s}`);f+=a.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${s}`);f+=a.move(" "),f+=a.move(n.safe(e.meta,{before:f,after:`
225
+ `,encode:["`"],...a.current()})),h()}return f+=a.move(`
226
+ `),o&&(f+=a.move(o+`
227
+ `)),f+=a.move(u),c(),f}function JZ(e,t,n){return(n?"":" ")+e}function S1(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function eK(e,t,n,r){const i=S1(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const u=n.createTracker(r);let c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(a=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":`
228
+ `,...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),a()),s(),c}function tK(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Uc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function wp(e,t,n){const r=Ml(e),i=Ml(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}aD.peek=nK;function aD(e,t,n,r){const i=tK(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i);let u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=u.charCodeAt(0),f=wp(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(u=Uc(c)+u.slice(1));const h=u.charCodeAt(u.length-1),p=wp(r.after.charCodeAt(0),h,i);p.inside&&(u=u.slice(0,-1)+Uc(h));const m=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+u+m}function nK(e,t,n){return n.options.emphasis||"*"}function rK(e,t){let n=!1;return b1(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,uw}),!!((!e.depth||e.depth<3)&&p1(e)&&(t.options.setext||n))}function iK(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(rK(e,n)){const f=n.enter("headingSetext"),h=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:`
229
+ `,after:`
230
+ `});return h(),f(),p+`
231
+ `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
232
+ `))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),u=n.enter("phrasing");o.move(s+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
233
+ `,...o.current()});return/^[\t ]/.test(c)&&(c=Uc(c.charCodeAt(0))+c.slice(1)),c=c?s+" "+c:s,n.options.closeAtx&&(c+=" "+s),u(),a(),c}lD.peek=oK;function lD(e){return e.value||""}function oK(){return"<"}uD.peek=sK;function uD(e,t,n,r){const i=S1(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(a=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),a()),c+=u.move(")"),s(),c}function sK(){return"!"}cD.peek=aK;function cD(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("![");const c=n.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(c+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!c||c!==h?u+=a.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function aK(){return"!"}dD.peek=lK;function dD(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let u;if(s.atBreak)for(;u=a.exec(r);){let c=u.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(u.index+1)}}return i+r+i}function lK(){return"`"}function fD(e,t){const n=p1(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}hD.peek=uK;function hD(e,t,n,r){const i=S1(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,u;if(fD(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let h=s.move("<");return h+=s.move(n.containerPhrasing(e,{before:h,after:">",...s.current()})),h+=s.move(">"),a(),n.stack=f,h}a=n.enter("link"),u=n.enter("label");let c=s.move("[");return c+=s.move(n.containerPhrasing(e,{before:c,after:"](",...s.current()})),c+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),c+=s.move("<"),c+=s.move(n.safe(e.url,{before:c,after:">",...s.current()})),c+=s.move(">")):(u=n.enter("destinationRaw"),c+=s.move(n.safe(e.url,{before:c,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=n.enter(`title${o}`),c+=s.move(" "+i),c+=s.move(n.safe(e.title,{before:c,after:i,...s.current()})),c+=s.move(i),u()),c+=s.move(")"),a(),c}function uK(e,t,n){return fD(e,n)?"<":"["}pD.peek=cK;function pD(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(c+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!c||c!==h?u+=a.move(h+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function cK(){return"["}function E1(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function dK(e){const t=E1(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function fK(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function mD(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function hK(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?fK(n):E1(n);const a=e.ordered?s==="."?")":".":dK(n);let u=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),mD(n)===s&&f){let h=-1;for(;++h<e.children.length;){const p=e.children[h];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),n.bulletCurrent=s;const c=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),c}function pK(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function mK(e,t,n,r){const i=pK(n);let o=n.bulletCurrent||E1(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),f);return u(),c;function f(h,p,m){return p?(m?"":" ".repeat(s))+h:(m?o:o+" ".repeat(s-o.length))+h}}function gK(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const yK=wm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vK(e,t,n,r){return(e.children.some(function(s){return yK(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function xK(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}gD.peek=wK;function gD(e,t,n,r){const i=xK(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let u=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const c=u.charCodeAt(0),f=wp(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(u=Uc(c)+u.slice(1));const h=u.charCodeAt(u.length-1),p=wp(r.after.charCodeAt(0),h,i);p.inside&&(u=u.slice(0,-1)+Uc(h));const m=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+u+m}function wK(e,t,n){return n.options.strong||"*"}function bK(e,t,n,r){return n.safe(e.value,r)}function kK(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function SK(e,t,n){const r=(mD(n)+(n.options.ruleSpaces?" ":"")).repeat(kK(n));return n.options.ruleSpaces?r.slice(0,-1):r}const yD={blockquote:YZ,break:LN,code:QZ,definition:eK,emphasis:aD,hardBreak:LN,heading:iK,html:lD,image:uD,imageReference:cD,inlineCode:dD,link:hD,linkReference:pD,list:hK,listItem:mK,paragraph:gK,root:vK,strong:gD,text:bK,thematicBreak:SK};function EK(){return{enter:{table:CK,tableData:FN,tableHeader:FN,tableRow:NK},exit:{codeText:TK,table:_K,tableData:Wv,tableHeader:Wv,tableRow:Wv}}}function CK(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function _K(e){this.exit(e),this.data.inTable=void 0}function NK(e){this.enter({type:"tableRow",children:[]},e)}function Wv(e){this.exit(e)}function FN(e){this.enter({type:"tableCell",children:[]},e)}function TK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,AK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function AK(e,t){return t==="|"?t:e}function PK(e){const t=e,n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
234
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:u,tableRow:a}};function s(m,y,x,k){return c(f(m,x,k),m.align)}function a(m,y,x,k){const w=h(m,x,k),E=c([w]);return E.slice(0,E.indexOf(`
235
+ `))}function u(m,y,x,k){const w=x.enter("tableCell"),E=x.enter("phrasing"),C=x.containerPhrasing(m,{...k,before:o,after:o});return E(),w(),C}function c(m,y){return UZ(m,{align:y,alignDelimiters:r,padding:n,stringLength:i})}function f(m,y,x){const k=m.children;let w=-1;const E=[],C=y.enter("table");for(;++w<k.length;)E[w]=h(k[w],y,x);return C(),E}function h(m,y,x){const k=m.children;let w=-1;const E=[],C=y.enter("tableRow");for(;++w<k.length;)E[w]=u(k[w],m,y,x);return C(),E}function p(m,y,x){let k=yD.inlineCode(m,y,x);return x.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function RK(){return{exit:{taskListCheckValueChecked:zN,taskListCheckValueUnchecked:zN,paragraph:DK}}}function MK(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:OK}}}function zN(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function DK(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function OK(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let u=yD.listItem(e,t,n,{...r,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),u;function c(f){return f+s}}function IK(){return[fZ(),EZ(),FZ(),EK(),RK()]}function jK(e){return{extensions:[hZ(),CZ(),zZ(),PK(e),MK()]}}const LK={tokenize:WK,partial:!0},vD={tokenize:UK,partial:!0},xD={tokenize:HK,partial:!0},wD={tokenize:YK,partial:!0},FK={tokenize:qK,partial:!0},bD={name:"wwwAutolink",tokenize:BK,previous:SD},kD={name:"protocolAutolink",tokenize:VK,previous:ED},No={name:"emailAutolink",tokenize:$K,previous:CD},Wi={};function zK(){return{text:Wi}}let Hs=48;for(;Hs<123;)Wi[Hs]=No,Hs++,Hs===58?Hs=65:Hs===91&&(Hs=97);Wi[43]=No;Wi[45]=No;Wi[46]=No;Wi[95]=No;Wi[72]=[No,kD];Wi[104]=[No,kD];Wi[87]=[No,bD];Wi[119]=[No,bD];function $K(e,t,n){const r=this;let i,o;return s;function s(h){return!hw(h)||!CD.call(r,r.previous)||C1(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(h))}function a(h){return hw(h)?(e.consume(h),a):h===64?(e.consume(h),u):n(h)}function u(h){return h===46?e.check(FK,f,c)(h):h===45||h===95||Wn(h)?(o=!0,e.consume(h),u):f(h)}function c(h){return e.consume(h),i=!0,u}function f(h){return o&&i&&er(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function BK(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!SD.call(r,r.previous)||C1(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(LK,e.attempt(vD,e.attempt(xD,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function VK(e,t,n){const r=this;let i="",o=!1;return s;function s(h){return(h===72||h===104)&&ED.call(r,r.previous)&&!C1(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),a):n(h)}function a(h){if(er(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),a;if(h===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(h),u}return n(h)}function u(h){return h===47?(e.consume(h),o?c:(o=!0,u)):n(h)}function c(h){return h===null||gp(h)||Pt(h)||aa(h)||ym(h)?n(h):e.attempt(vD,e.attempt(xD,f),n)(h)}function f(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function WK(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function UK(e,t,n){let r,i,o;return s;function s(c){return c===46||c===95?e.check(wD,u,a)(c):c===null||Pt(c)||aa(c)||c!==45&&ym(c)?u(c):(o=!0,e.consume(c),s)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),s}function u(c){return i||r||!o?n(c):t(c)}}function HK(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(wD,t,o)(s):s===null||Pt(s)||aa(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function YK(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||Pt(a)||aa(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Pt(a)||aa(a)?t(a):r(a)}function o(a){return er(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):er(a)?(e.consume(a),s):n(a)}}function qK(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return Wn(o)?n(o):t(o)}}function SD(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Pt(e)}function ED(e){return!er(e)}function CD(e){return!(e===47||hw(e))}function hw(e){return e===43||e===45||e===46||e===95||Wn(e)}function C1(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const GK={tokenize:nX,partial:!0};function ZK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:JK,continuation:{tokenize:eX},exit:tX}},text:{91:{name:"gfmFootnoteCall",tokenize:QK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:KK,resolveTo:XK}}}}function KK(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return n(u);const c=ui(r.sliceSerialize({start:s.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function XK(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function QK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(h){if(o>999||h===93&&!s||h===null||h===91||Pt(h))return n(h);if(h===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(ui(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return Pt(h)||(s=!0),o++,e.consume(h),h===92?f:c}function f(h){return h===91||h===92||h===93?(e.consume(h),o++,c):c(h)}}function JK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return u;function u(y){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(y)}function f(y){if(s>999||y===93&&!a||y===null||y===91||Pt(y))return n(y);if(y===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=ui(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Pt(y)||(a=!0),s++,e.consume(y),y===92?h:f}function h(y){return y===91||y===92||y===93?(e.consume(y),s++,f):f(y)}function p(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),i.includes(o)||i.push(o),xt(e,m,"gfmFootnoteDefinitionWhitespace")):n(y)}function m(y){return t(y)}}function eX(e,t,n){return e.check(Md,t,e.attempt(GK,t,n))}function tX(e){e.exit("gfmFootnoteDefinition")}function nX(e,t,n){const r=this;return xt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function rX(e){let n=e.singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let c=u;for(;c--;)if(s[c][0]==="exit"&&s[c][1].type==="strikethroughSequenceTemporary"&&s[c][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[c][1].end.offset-s[c][1].start.offset){s[u][1].type="strikethroughSequence",s[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[c][1].start),end:Object.assign({},s[u][1].end)},h={type:"strikethroughText",start:Object.assign({},s[c][1].end),end:Object.assign({},s[u][1].start)},p=[["enter",f,a],["enter",s[c][1],a],["exit",s[c][1],a],["enter",h,a]],m=a.parser.constructs.insideSpan.null;m&&_r(p,p.length,0,vm(m,s.slice(c+1,u),a)),_r(p,p.length,0,[["exit",h,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",f,a]]),_r(s,c-1,u-c+3,p),u=c+p.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,a,u){const c=this.previous,f=this.events;let h=0;return p;function p(y){return c===126&&f[f.length-1][1].type!=="characterEscape"?u(y):(s.enter("strikethroughSequenceTemporary"),m(y))}function m(y){const x=Ml(c);if(y===126)return h>1?u(y):(s.consume(y),h++,m);if(h<2&&!n)return u(y);const k=s.exit("strikethroughSequenceTemporary"),w=Ml(y);return k._open=!w||w===2&&!!x,k._close=!x||x===2&&!!w,a(y)}}}class iX{constructor(){this.map=[]}add(t,n,r){oX(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let i=r.pop();for(;i;)t.push(...i),i=r.pop();this.map.length=0}}function oX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function sX(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function aX(){return{flow:{null:{name:"table",tokenize:lX,resolveAll:uX}}}}function lX(e,t,n){const r=this;let i=0,o=0,s;return a;function a(R){let $=r.events.length-1;for(;$>-1;){const I=r.events[$][1].type;if(I==="lineEnding"||I==="linePrefix")$--;else break}const F=$>-1?r.events[$][1].type:null,H=F==="tableHead"||F==="tableRow"?A:u;return H===A&&r.parser.lazy[r.now().line]?n(R):H(R)}function u(R){return e.enter("tableHead"),e.enter("tableRow"),c(R)}function c(R){return R===124||(s=!0,o+=1),f(R)}function f(R){return R===null?n(R):Ze(R)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),m):n(R):mt(R)?xt(e,f,"whitespace")(R):(o+=1,s&&(s=!1,i+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),h(R)))}function h(R){return R===null||R===124||Pt(R)?(e.exit("data"),f(R)):(e.consume(R),R===92?p:h)}function p(R){return R===92||R===124?(e.consume(R),h):h(R)}function m(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(R):(e.enter("tableDelimiterRow"),s=!1,mt(R)?xt(e,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):y(R))}function y(R){return R===45||R===58?k(R):R===124?(s=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),x):P(R)}function x(R){return mt(R)?xt(e,k,"whitespace")(R):k(R)}function k(R){return R===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),w):R===45?(o+=1,w(R)):R===null||Ze(R)?N(R):P(R)}function w(R){return R===45?(e.enter("tableDelimiterFiller"),E(R)):P(R)}function E(R){return R===45?(e.consume(R),E):R===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(R))}function C(R){return mt(R)?xt(e,N,"whitespace")(R):N(R)}function N(R){return R===124?y(R):R===null||Ze(R)?!s||i!==o?P(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):P(R)}function P(R){return n(R)}function A(R){return e.enter("tableRow"),O(R)}function O(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),O):R===null||Ze(R)?(e.exit("tableRow"),t(R)):mt(R)?xt(e,O,"whitespace")(R):(e.enter("data"),M(R))}function M(R){return R===null||R===124||Pt(R)?(e.exit("data"),O(R)):(e.consume(R),R===92?j:M)}function j(R){return R===92||R===124?(e.consume(R),M):M(R)}}function uX(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,c,f,h;const p=new iX;for(;++n<e.length;){const m=e[n],y=m[1];m[0]==="enter"?y.type==="tableHead"?(a=!1,u!==0&&($N(p,t,u,c,f),f=void 0,u=0),c={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.add(n,0,[["enter",c,t]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(r=!0,h=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.add(n,0,[["enter",f,t]])),i=y.type==="tableDelimiterRow"?2:f?3:1):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],h=Nh(p,t,o,i,void 0,h),o=[0,0,0,0]),s[2]=n)):y.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],h=Nh(p,t,o,i,void 0,h)),o=s,s=[o[1],n,0,0])):y.type==="tableHead"?(a=!0,u=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(u=n,o[1]!==0?(s[0]=s[1],h=Nh(p,t,o,i,n,h)):s[1]!==0&&(h=Nh(p,t,s,i,n,h)),i=0):i&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&$N(p,t,u,c,f),p.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=sX(t.events,n))}return e}function Nh(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},sl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=sl(t.events,n[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=sl(t.events,n[2]),f=sl(t.events,n[3]),h={type:a,start:Object.assign({},c),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const p=t.events[n[2]],m=t.events[n[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,x=n[3]-n[2]-1;e.add(y,x,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(o.end=Object.assign({},sl(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function $N(e,t,n,r,i){const o=[],s=sl(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function sl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const cX={name:"tasklistCheck",tokenize:fX};function dX(){return{text:{91:cX}}}function fX(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return Pt(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(u)}function a(u){return Ze(u)?t(u):mt(u)?e.check({tokenize:hX},t,n)(u):n(u)}}function hX(e,t,n){return xt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function pX(e){return L2([zK(),ZK(),rX(e),aX(),dX()])}const mX={};function gX(e){const t=this,n=e||mX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(pX(n)),o.push(IK()),s.push(jK(n))}const yX="modulepreload",vX=function(e){return"/"+e},BN={},xX=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(u=>{if(u=vX(u),u in BN)return;BN[u]=!0;const c=u.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":yX,c||(h.as="script"),h.crossOrigin="",h.href=u,a&&h.setAttribute("nonce",a),document.head.appendChild(h),c)return new Promise((p,m)=>{h.addEventListener("load",p),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};async function wX(e,t){const{codeToTokens:n,bundledLanguages:r}=await xX(async()=>{const{codeToTokens:o,bundledLanguages:s}=await import("./index-Cke4BidO.js");return{codeToTokens:o,bundledLanguages:s}},[]);if(!(t in r))return null;const{tokens:i}=await n(e,{lang:t,defaultColor:!1,themes:{light:"github-light",dark:"github-dark"}});return i}function bX({children:e}){const t=e.replace(/\\n/g,`
236
+ `);return v.jsx(oZ,{remarkPlugins:[gX],components:SX,className:"space-y-3",children:t})}const _D=ne.memo(({children:e,language:t,...n})=>{const[r,i]=S.useState([]);return S.useEffect(()=>{wX(e,t).then(o=>{o&&i(o)})},[e,t]),r.length?v.jsx("pre",{...n,children:v.jsx("code",{children:r.map((o,s)=>v.jsxs(v.Fragment,{children:[v.jsx("span",{children:o.map((a,u)=>{const c=typeof a.htmlStyle=="string"?void 0:a.htmlStyle;return v.jsx("span",{className:"text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",style:c,children:a.content},u)})},s),s!==r.length-1&&`
237
+ `]}))})}):v.jsx("pre",{...n,children:e})});_D.displayName="HighlightedCode";const kX=({children:e,className:t,language:n,...r})=>{const i=typeof e=="string"?e:pw(e),o=Te("overflow-x-scroll rounded-md border bg-background/50 p-4 font-mono text-sm [scrollbar-width:none]",t);return v.jsxs("div",{className:"group/code relative mb-4",children:[v.jsx(S.Suspense,{fallback:v.jsx("pre",{className:o,...r,children:e}),children:v.jsx(_D,{language:n,className:o,children:i})}),v.jsx("div",{className:"invisible absolute right-2 top-2 flex space-x-1 rounded-lg p-1 opacity-0 transition-all duration-200 group-hover/code:visible group-hover/code:opacity-100",children:v.jsx(um,{content:i,copyMessage:"Copied code to clipboard"})})]})};function pw(e){var t;if(typeof e=="string")return e;if((t=e==null?void 0:e.props)!=null&&t.children){let n=e.props.children;return Array.isArray(n)?n.map(r=>pw(r)).join(""):pw(n)}return""}const SX={h1:On("h1","text-2xl font-semibold"),h2:On("h2","font-semibold text-xl"),h3:On("h3","font-semibold text-lg"),h4:On("h4","font-semibold text-base"),h5:On("h5","font-medium"),strong:On("strong","font-semibold"),a:On("a","text-primary underline underline-offset-2"),blockquote:On("blockquote","border-l-2 border-primary pl-4"),code:({children:e,className:t,node:n,...r})=>{const i=/language-(\w+)/.exec(t||"");return i?v.jsx(kX,{className:t,language:i[1],...r,children:e}):v.jsx("code",{className:Te("font-mono [:not(pre)>&]:rounded-md [:not(pre)>&]:bg-background/50 [:not(pre)>&]:px-1 [:not(pre)>&]:py-0.5"),...r,children:e})},pre:({children:e})=>e,ol:On("ol","list-decimal space-y-2 pl-6"),ul:On("ul","list-disc space-y-2 pl-6"),li:On("li","my-1.5"),table:On("table","w-full border-collapse overflow-y-auto rounded-md border border-foreground/20"),th:On("th","border border-foreground/20 px-4 py-2 text-left font-bold [&[align=center]]:text-center [&[align=right]]:text-right"),td:On("td","border border-foreground/20 px-4 py-2 text-left [&[align=center]]:text-center [&[align=right]]:text-right"),tr:On("tr","m-0 border-t p-0 even:bg-muted"),p:On("p","whitespace-pre-wrap leading-relaxed"),hr:On("hr","border-foreground/20")};function On(e,t){const n=({node:r,...i})=>v.jsx(e,{className:t,...i});return n.displayName=e,n}const EX=nu("group/message relative break-words rounded-lg p-3 text-sm sm:max-w-[70%]",{variants:{isUser:{true:"bg-primary text-primary-foreground",false:"bg-muted text-foreground"},isError:{true:"bg-red-100 dark:bg-red-900/20",false:""},animation:{none:"",slide:"duration-300 animate-in fade-in-0",scale:"duration-300 animate-in fade-in-0 zoom-in-75",fade:"duration-500 animate-in fade-in-0"}},compoundVariants:[{isUser:!0,animation:"slide",class:"slide-in-from-right"},{isUser:!1,animation:"slide",class:"slide-in-from-left"},{isUser:!0,animation:"scale",class:"origin-bottom-right"},{isUser:!1,animation:"scale",class:"origin-bottom-left"}]}),CX=({role:e,content:t,createdAt:n,showTimeStamp:r=!1,animation:i="scale",actions:o,className:s,experimental_attachments:a,isError:u=!1})=>{const c=e==="user",f=S.useMemo(()=>a==null?void 0:a.map(p=>{const m=_X(p.url);return new File([m],p.name??"Unknown")}),[a]),h=n==null?void 0:n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return v.jsxs("div",{className:Te("flex flex-col",c?"items-end":"items-start"),children:[f?v.jsx("div",{className:"mb-1 flex gap-2 flex-wrap",children:f.map((p,m)=>v.jsx(a1,{file:p},m))}):null,v.jsxs("div",{className:Te(EX({isUser:c,isError:u,animation:i}),s),children:[v.jsx("div",{children:v.jsx(bX,{children:t})}),e==="assistant"&&o?v.jsx("div",{className:"absolute -bottom-4 right-2 flex space-x-1 rounded-lg border bg-background p-1 opacity-0 transition-opacity group-hover/message:opacity-100 text-foreground",children:o}):null]}),r&&n?v.jsx("time",{dateTime:n.toISOString(),className:Te("mt-1 block px-1 text-xs opacity-50",i!=="none"&&"duration-500 animate-in fade-in-0"),children:h}):null]})};function _X(e){const t=e.split(",")[1],n=Buffer.from(t??"","base64");return new Uint8Array(n)}function NX(){return v.jsx("div",{className:"justify-left flex space-x-1",children:v.jsx("div",{className:"rounded-lg bg-muted p-3",children:v.jsxs("div",{className:"flex -space-x-2.5",children:[v.jsx(iv,{className:"h-5 w-5 animate-typing-dot-bounce"}),v.jsx(iv,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:90ms]"}),v.jsx(iv,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:180ms]"})]})})})}function TX({messages:e,showTimeStamps:t=!0,isTyping:n=!1,messageOptions:r}){return v.jsxs("div",{className:"space-y-4 overflow-visible",children:[e.map((i,o)=>{const s=typeof r=="function"?r(i):r;return i.role==="assistant"&&!i.content.trim()?null:v.jsx(CX,{showTimeStamp:t,...i,...s},o)}),n&&v.jsx(NX,{})]})}function AX({label:e,append:t,suggestions:n}){return v.jsxs("div",{className:"space-y-6",children:[v.jsx("h2",{className:"text-center text-2xl font-bold",children:e}),v.jsx("div",{className:"flex flex-col sm:flex-row gap-6 text-sm items-center justify-center",children:n.map(r=>v.jsx("button",{onClick:()=>t({role:"user",content:r}),className:"h-max rounded-xl border bg-transparent p-4 hover:bg-accent",children:v.jsx("p",{children:r})},r))})]})}const PX=50;function RX(e){const t=S.useRef(null),n=S.useRef(null),[r,i]=S.useState(!0),o=()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)},s=()=>{if(t.current){const{scrollTop:u,scrollHeight:c,clientHeight:f}=t.current;if(n.current?u<n.current:!1)i(!1);else{const p=Math.abs(c-u-f)<PX;i(p)}n.current=u}},a=()=>{i(!1)};return S.useEffect(()=>{t.current&&(n.current=t.current.scrollTop)},[]),S.useEffect(()=>{r&&o()},e),{containerRef:t,scrollToBottom:o,handleScroll:s,shouldAutoScroll:r,handleTouchStart:a}}function MX({messages:e,children:t}){const{containerRef:n,scrollToBottom:r,handleScroll:i,shouldAutoScroll:o,handleTouchStart:s}=RX([e]);return v.jsxs("div",{className:"grid overflow-y-auto pb-4 grid-cols-1",ref:n,onScroll:i,onTouchStart:s,children:[v.jsx("div",{className:"[grid-column:1/1] [grid-row:1/1] max-w-full",children:t}),v.jsx("div",{className:"flex justify-end items-end [grid-column:1/1] [grid-row:1/1] flex-1",children:!o&&v.jsx("div",{className:"sticky bottom-0 left-0 flex w-full justify-end",children:v.jsx(Bt,{onClick:r,className:"h-8 w-8 rounded-full ease-in-out animate-in fade-in-0 slide-in-from-bottom-1",size:"icon",variant:"ghost",children:v.jsx(zB,{className:"h-4 w-4"})})})})]})}const ND=S.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:Te("grid max-h-full w-full grid-rows-[1fr_auto]",e),...t}));ND.displayName="ChatContainer";const TD=S.forwardRef(({children:e,handleSubmit:t,isPending:n,className:r},i)=>{const[o,s]=S.useState(null),a=u=>{if(n){u.preventDefault();return}if(!o){t(u);return}const c=DX(o);t(u,{experimental_attachments:c}),s(null)};return v.jsx("form",{ref:i,onSubmit:a,className:r,children:e({files:o,setFiles:s})})});TD.displayName="ChatForm";function DX(e){const t=new DataTransfer;for(const n of Array.from(e))t.items.add(n);return t.files}function OX({agentId:e,initialMessages:t=[],agentName:n,threadId:r,memory:i}){const[o,s]=S.useState(t),[a,u]=S.useState(""),[c,f]=S.useState(!1),{mutate:h}=Cb();S.useEffect(()=>{t&&s(t)},[t]);const p=S.useCallback(C=>{u(C.target.value)},[]),m=async C=>{var O,M;if((O=C==null?void 0:C.preventDefault)==null||O.call(C),!a.trim()||c)return;const N=a;u(""),f(!0);const P={id:Date.now().toString(),role:"user",content:N},A={id:(Date.now()+1).toString(),role:"assistant",content:""};s(j=>[...j,P,A]);try{const j=await fetch("/api/agents/"+e+"/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[N],...i?{threadId:r,resourceid:e}:{}})});if(!j.body)return;if(j.status!==200){const I=await j.json();s(Y=>[...Y.slice(0,-1),{...Y[Y.length-1],content:I.error,isError:!0}]);return}h(`/api/memory/threads?resourceid=${e}`);const R=j.body.getReader(),$=new TextDecoder;let F="",H="";for(;;){const{done:I,value:Y}=await R.read();if(I)break;const q=$.decode(Y);if(F+=q,(M=F==null?void 0:F.toLocaleLowerCase())!=null&&M.includes("an error occurred")){s(B=>[...B.slice(0,-1),{...B[B.length-1],content:"An error occurred while processing your request.",isError:!0}]);return}const Z=F.matchAll(/0:"([^"]*)"/g);for(const B of Z){const W=B[1];H+=W,s(L=>[...L.slice(0,-1),{...L[L.length-1],content:H}])}F=""}}catch(j){console.error("Error:",j),s(R=>[...R.slice(0,-1),{...R[R.length-1],content:"An error occurred while processing your request.",isError:!0}])}finally{f(!1)}},y=o.at(-1),x=o.length===0,k=c||(y==null?void 0:y.role)==="assistant"&&!(y!=null&&y.content.trim()),w=S.useCallback(C=>{u(C.content),m()},[m]),E=["What capabilities do you have?","How can you help me?","Tell me about yourself"];return v.jsxs(ND,{className:"h-full p-4 max-w-[1000px] mx-auto",children:[v.jsx("div",{className:"flex flex-col h-full py-4",children:x?v.jsx("div",{className:"mx-auto max-w-2xl",children:v.jsx(AX,{label:`Chat with ${n}`,append:w,suggestions:E})}):v.jsx(fr,{className:" h-[calc(100vh-15rem)] px-4",children:v.jsx(MX,{messages:o,children:v.jsx(TX,{messages:o,isTyping:k})})})}),v.jsx(TD,{className:"mt-auto ",isPending:c||k,handleSubmit:m,children:({files:C,setFiles:N})=>v.jsx(b2,{value:a,onChange:p,files:C,setFiles:N,isGenerating:c,placeholder:"Enter your message..."})})]})}const AD=S.forwardRef(({...e},t)=>v.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));AD.displayName="Breadcrumb";const PD=S.forwardRef(({className:e,...t},n)=>v.jsx("ol",{ref:n,className:Te("text-mastra-el-6 flex items-center gap-2 break-words text-[calc(13_/_16_*_1rem)] font-medium",e),...t}));PD.displayName="BreadcrumbList";const RD=S.forwardRef(({className:e,...t},n)=>v.jsx("li",{ref:n,className:Te("inline-flex items-center gap-1.5",e),...t}));RD.displayName="BreadcrumbItem";const MD=S.forwardRef(({asChild:e,className:t,...n},r)=>{const i=e?Li:"a";return v.jsx(i,{ref:r,className:Te("hover:text-text transition-colors",t),...n})});MD.displayName="BreadcrumbLink";const DD=S.forwardRef(({className:e,...t},n)=>v.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Te("text-mastra-el-5 text-sm font-medium",e),...t}));DD.displayName="BreadcrumbPage";const OD=({children:e,className:t,...n})=>v.jsx("li",{role:"presentation","aria-hidden":"true",className:Te(t),...n,children:e??v.jsx(hb,{className:"text-mastra-el-3 !h-[0.625rem] !w-[0.625rem] -rotate-90"})});OD.displayName="BreadcrumbSeparator";function km({items:e,pageClassName:t,icon:n}){return v.jsxs("div",{className:"flex items-center gap-4",children:[n,v.jsx(AD,{children:v.jsx(PD,{children:e.map((r,i)=>v.jsxs("span",{className:"flex flex-nowrap items-center gap-2",children:[v.jsx(RD,{children:r.isCurrent?v.jsx(DD,{className:t,children:r.label}):v.jsx(MD,{asChild:!0,children:v.jsx(Ed,{to:r.href,className:"text-mastra-el-3",children:r.label})})},r.href),i<e.length-1&&v.jsx(OD,{})]},i))})})]})}function _1(e){const t=e+"CollectionProvider",[n,r]=Yr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:y,children:x}=m,k=ne.useRef(null),w=ne.useRef(new Map).current;return v.jsx(i,{scope:y,itemMap:w,collectionRef:k,children:x})};s.displayName=t;const a=e+"CollectionSlot",u=ne.forwardRef((m,y)=>{const{scope:x,children:k}=m,w=o(a,x),E=pt(y,w.collectionRef);return v.jsx(Li,{ref:E,children:k})});u.displayName=a;const c=e+"CollectionItemSlot",f="data-radix-collection-item",h=ne.forwardRef((m,y)=>{const{scope:x,children:k,...w}=m,E=ne.useRef(null),C=pt(y,E),N=o(c,x);return ne.useEffect(()=>(N.itemMap.set(E,{ref:E,...w}),()=>void N.itemMap.delete(E))),v.jsx(Li,{[f]:"",ref:C,children:k})});h.displayName=c;function p(m){const y=o(e+"CollectionConsumer",m);return ne.useCallback(()=>{const k=y.collectionRef.current;if(!k)return[];const w=Array.from(k.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((N,P)=>w.indexOf(N.ref.current)-w.indexOf(P.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:u,ItemSlot:h},p,r]}var IX=r$.useId||(()=>{}),jX=0;function En(e){const[t,n]=S.useState(IX());return Un(()=>{e||n(r=>r??String(jX++))},[e]),e||(t?`radix-${t}`:"")}function wo({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=LX({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=fn(n),u=S.useCallback(c=>{if(o){const h=typeof c=="function"?c(e):c;h!==e&&a(h)}else i(c)},[o,e,i,a]);return[s,u]}function LX({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,i=S.useRef(r),o=fn(t);return S.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var Uv="rovingFocusGroup.onEntryFocus",FX={bubbles:!1,cancelable:!0},Sm="RovingFocusGroup",[mw,ID,zX]=_1(Sm),[$X,Em]=Yr(Sm,[zX]),[BX,VX]=$X(Sm),jD=S.forwardRef((e,t)=>v.jsx(mw.Provider,{scope:e.__scopeRovingFocusGroup,children:v.jsx(mw.Slot,{scope:e.__scopeRovingFocusGroup,children:v.jsx(WX,{...e,ref:t})})}));jD.displayName=Sm;var WX=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...h}=e,p=S.useRef(null),m=pt(t,p),y=Cd(o),[x=null,k]=wo({prop:s,defaultProp:a,onChange:u}),[w,E]=S.useState(!1),C=fn(c),N=ID(n),P=S.useRef(!1),[A,O]=S.useState(0);return S.useEffect(()=>{const M=p.current;if(M)return M.addEventListener(Uv,C),()=>M.removeEventListener(Uv,C)},[C]),v.jsx(BX,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:x,onItemFocus:S.useCallback(M=>k(M),[k]),onItemShiftTab:S.useCallback(()=>E(!0),[]),onFocusableItemAdd:S.useCallback(()=>O(M=>M+1),[]),onFocusableItemRemove:S.useCallback(()=>O(M=>M-1),[]),children:v.jsx(Ue.div,{tabIndex:w||A===0?-1:0,"data-orientation":r,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{P.current=!0}),onFocus:Re(e.onFocus,M=>{const j=!P.current;if(M.target===M.currentTarget&&j&&!w){const R=new CustomEvent(Uv,FX);if(M.currentTarget.dispatchEvent(R),!R.defaultPrevented){const $=N().filter(q=>q.focusable),F=$.find(q=>q.active),H=$.find(q=>q.id===x),Y=[F,H,...$].filter(Boolean).map(q=>q.ref.current);zD(Y,f)}}P.current=!1}),onBlur:Re(e.onBlur,()=>E(!1))})})}),LD="RovingFocusGroupItem",FD=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=En(),u=o||a,c=VX(LD,n),f=c.currentTabStopId===u,h=ID(n),{onFocusableItemAdd:p,onFocusableItemRemove:m}=c;return S.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),v.jsx(mw.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:v.jsx(Ue.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Re(e.onMouseDown,y=>{r?c.onItemFocus(u):y.preventDefault()}),onFocus:Re(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:Re(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=YX(y,c.orientation,c.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=h().filter(E=>E.focusable).map(E=>E.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const E=w.indexOf(y.currentTarget);w=c.loop?qX(w,E+1):w.slice(E+1)}setTimeout(()=>zD(w))}})})})});FD.displayName=LD;var UX={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function HX(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function YX(e,t,n){const r=HX(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return UX[r]}function zD(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var $D=jD,BD=FD,N1="Tabs",[GX,kve]=Yr(N1,[Em]),VD=Em(),[ZX,T1]=GX(N1),WD=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:u="automatic",...c}=e,f=Cd(a),[h,p]=wo({prop:r,onChange:i,defaultProp:o});return v.jsx(ZX,{scope:n,baseId:En(),value:h,onValueChange:p,orientation:s,dir:f,activationMode:u,children:v.jsx(Ue.div,{dir:f,"data-orientation":s,...c,ref:t})})});WD.displayName=N1;var UD="TabsList",HD=S.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=T1(UD,n),s=VD(n);return v.jsx($D,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:v.jsx(Ue.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});HD.displayName=UD;var YD="TabsTrigger",qD=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=T1(YD,n),a=VD(n),u=KD(s.baseId,r),c=XD(s.baseId,r),f=r===s.value;return v.jsx(BD,{asChild:!0,...a,focusable:!i,active:f,children:v.jsx(Ue.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:Re(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:Re(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:Re(e.onFocus,()=>{const h=s.activationMode!=="manual";!f&&!i&&h&&s.onValueChange(r)})})})});qD.displayName=YD;var GD="TabsContent",ZD=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=T1(GD,n),u=KD(a.baseId,r),c=XD(a.baseId,r),f=r===a.value,h=S.useRef(f);return S.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),v.jsx(nr,{present:i||f,children:({present:p})=>v.jsx(Ue.div,{"data-state":f?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":u,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&o})})});ZD.displayName=GD;function KD(e,t){return`${e}-trigger-${t}`}function XD(e,t){return`${e}-content-${t}`}var KX=WD,QD=HD,JD=qD,eO=ZD;const tO=KX,A1=S.forwardRef(({className:e,...t},n)=>v.jsx(QD,{ref:n,className:Te(e),...t}));A1.displayName=QD.displayName;const na=S.forwardRef(({className:e,...t},n)=>v.jsx(JD,{ref:n,className:Te(e),...t}));na.displayName=JD.displayName;const ra=S.forwardRef(({className:e,...t},n)=>v.jsx(eO,{ref:n,className:Te("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ra.displayName=eO.displayName;function XX({agentId:e}){var i;const{isLoading:t,agent:n}=im(e),r=ks();return t?v.jsx(fr,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx(Je,{className:"h-3"}),v.jsx(Je,{className:"h-3"})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx(Je,{className:"h-3"}),v.jsx(Je,{className:"h-3"})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx(Je,{className:"h-3"}),v.jsx(Je,{className:"h-3"})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx(Je,{className:"h-3"}),v.jsx(Je,{className:"h-3"})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx(Je,{className:"h-3"}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Je,{className:"h-3"}),v.jsx(Je,{className:"h-3"}),v.jsx(Je,{className:"h-3"})]})]})]})}):v.jsx(fr,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"Name"}),v.jsx("p",{className:"text-mastra-el-5",children:n==null?void 0:n.name})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"Instructions"}),v.jsx("p",{className:"text-mastra-el-5 whitespace-pre-wrap",children:n==null?void 0:n.instructions})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"Model"}),v.jsx("p",{className:"text-mastra-el-5",children:(i=n==null?void 0:n.model)==null?void 0:i.name})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"Provider"}),v.jsx("p",{className:"text-mastra-el-5",children:n==null?void 0:n.model.provider})]}),v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"Tools"}),v.jsx("div",{className:"flex flex-col gap-2 text-mastra-el-5",children:Object.entries((n==null?void 0:n.tools)??{}).map(([o,s])=>v.jsx("span",{onClick:()=>{r(`/tools/${e}/${s.id}`)},className:"no-underline",children:s.id},o))})]})]})})}function QX({agentId:e}){return v.jsx(fr,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs w-[400px]",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"GET"}),v.jsx("p",{className:"text-mastra-el-5",children:"/api/agents"})]}),v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"GET"}),v.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e]})]}),v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"POST"}),v.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/generate"]})]}),v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"POST"}),v.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/stream"]})]}),v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"POST"}),v.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/text-object"]})]}),v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"POST"}),v.jsxs("p",{className:"text-mastra-el-5",children:["/api/agents/",e,"/stream-object"]})]})]})})}const nO=e=>{const[t,n]=S.useState([]),[r,i]=S.useState(!0),o=async s=>{i(!0);try{const a=await fetch(`/api/logs/${s??e}`);if(!a.ok){const c=await a.json();n([]),console.error("Error fetching logs",c),mn.error((c==null?void 0:c.error)||"Error fetching logs");return}const u=await a.json();n(u)}catch(a){n([]),console.error("Error fetching logs",a),mn.error("Error fetching logs")}finally{i(!1)}};return S.useEffect(()=>{o(e)},[e]),{logs:t,isLoading:r,refetchLogs:o}};function JX({agentId:e}){const{logs:t,isLoading:n,refetchLogs:r}=nO(e);return v.jsxs(fr,{className:"h-[calc(100vh-126px)] px-4 pb-4 text-xs w-[400px]",children:[v.jsx("div",{className:"flex justify-end sticky top-0 bg-mastra-bg-2 py-2",children:v.jsx(Bt,{variant:"outline",onClick:()=>r(),children:n?v.jsx(sp,{className:"w-4 h-4 animate-spin"}):v.jsx(sp,{className:"w-4 h-4"})})}),v.jsx("div",{className:"space-y-4",children:t.length===0?v.jsx("p",{className:"text-mastra-el-5",children:"No logs yet"}):t.map(i=>{const o=JSON.parse(i.message);return v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsxs("p",{className:"text-mastra-el-4",children:["[",i.timestamp,"]"]}),v.jsxs("p",{className:"text-mastra-el-5",children:["[",i.level,"]"]})]}),v.jsx("p",{className:"text-mastra-el-5 whitespace-pre-wrap",children:v.jsx("code",{children:JSON.stringify(o,null,2)})})]},i.timestamp)})})]})}function VN({agentId:e}){return v.jsxs(tO,{defaultValue:"details",children:[v.jsxs(A1,{className:"flex shrink-0 border-b",children:[v.jsx(na,{value:"details",className:"group",children:v.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Details"})}),v.jsx(na,{value:"endpoints",className:"group",children:v.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Endpoints"})}),v.jsx(na,{value:"logs",className:"group",children:v.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Logs"})})]}),v.jsx(ra,{value:"details",children:e?v.jsx(XX,{agentId:e}):null}),v.jsx(ra,{value:"endpoints",children:v.jsx(QX,{agentId:e})}),v.jsx(ra,{value:"logs",children:v.jsx(JX,{agentId:e})})]})}function eQ(e,t=globalThis==null?void 0:globalThis.document){const n=fn(e);S.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var tQ="DismissableLayer",gw="dismissableLayer.update",nQ="dismissableLayer.pointerDownOutside",rQ="dismissableLayer.focusOutside",WN,rO=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Od=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...u}=e,c=S.useContext(rO),[f,h]=S.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=S.useState({}),y=pt(t,O=>h(O)),x=Array.from(c.layers),[k]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=x.indexOf(k),E=f?x.indexOf(f):-1,C=c.layersWithOutsidePointerEventsDisabled.size>0,N=E>=w,P=sQ(O=>{const M=O.target,j=[...c.branches].some(R=>R.contains(M));!N||j||(i==null||i(O),s==null||s(O),O.defaultPrevented||a==null||a())},p),A=aQ(O=>{const M=O.target;[...c.branches].some(R=>R.contains(M))||(o==null||o(O),s==null||s(O),O.defaultPrevented||a==null||a())},p);return eQ(O=>{E===c.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&a&&(O.preventDefault(),a()))},p),S.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(WN=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),UN(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=WN)}},[f,p,n,c]),S.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),UN())},[f,c]),S.useEffect(()=>{const O=()=>m({});return document.addEventListener(gw,O),()=>document.removeEventListener(gw,O)},[]),v.jsx(Ue.div,{...u,ref:y,style:{pointerEvents:C?N?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,P.onPointerDownCapture)})});Od.displayName=tQ;var iQ="DismissableLayerBranch",oQ=S.forwardRef((e,t)=>{const n=S.useContext(rO),r=S.useRef(null),i=pt(t,r);return S.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),v.jsx(Ue.div,{...e,ref:i})});oQ.displayName=iQ;function sQ(e,t=globalThis==null?void 0:globalThis.document){const n=fn(e),r=S.useRef(!1),i=S.useRef(()=>{});return S.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let u=function(){iO(nQ,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function aQ(e,t=globalThis==null?void 0:globalThis.document){const n=fn(e),r=S.useRef(!1);return S.useEffect(()=>{const i=o=>{o.target&&!r.current&&iO(rQ,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function UN(){const e=new CustomEvent(gw);document.dispatchEvent(e)}function iO(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?wR(i,o):i.dispatchEvent(o)}var Hv="focusScope.autoFocusOnMount",Yv="focusScope.autoFocusOnUnmount",HN={bubbles:!1,cancelable:!0},lQ="FocusScope",Id=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,u]=S.useState(null),c=fn(i),f=fn(o),h=S.useRef(null),p=pt(t,x=>u(x)),m=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let x=function(C){if(m.paused||!a)return;const N=C.target;a.contains(N)?h.current=N:os(h.current,{select:!0})},k=function(C){if(m.paused||!a)return;const N=C.relatedTarget;N!==null&&(a.contains(N)||os(h.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const P of C)P.removedNodes.length>0&&os(a)};document.addEventListener("focusin",x),document.addEventListener("focusout",k);const E=new MutationObserver(w);return a&&E.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",k),E.disconnect()}}},[r,a,m.paused]),S.useEffect(()=>{if(a){qN.add(m);const x=document.activeElement;if(!a.contains(x)){const w=new CustomEvent(Hv,HN);a.addEventListener(Hv,c),a.dispatchEvent(w),w.defaultPrevented||(uQ(pQ(oO(a)),{select:!0}),document.activeElement===x&&os(a))}return()=>{a.removeEventListener(Hv,c),setTimeout(()=>{const w=new CustomEvent(Yv,HN);a.addEventListener(Yv,f),a.dispatchEvent(w),w.defaultPrevented||os(x??document.body,{select:!0}),a.removeEventListener(Yv,f),qN.remove(m)},0)}}},[a,c,f,m]);const y=S.useCallback(x=>{if(!n&&!r||m.paused)return;const k=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,w=document.activeElement;if(k&&w){const E=x.currentTarget,[C,N]=cQ(E);C&&N?!x.shiftKey&&w===N?(x.preventDefault(),n&&os(C,{select:!0})):x.shiftKey&&w===C&&(x.preventDefault(),n&&os(N,{select:!0})):w===E&&x.preventDefault()}},[n,r,m.paused]);return v.jsx(Ue.div,{tabIndex:-1,...s,ref:p,onKeyDown:y})});Id.displayName=lQ;function uQ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(os(r,{select:t}),document.activeElement!==n)return}function cQ(e){const t=oO(e),n=YN(t,e),r=YN(t.reverse(),e);return[n,r]}function oO(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function YN(e,t){for(const n of e)if(!dQ(n,{upTo:t}))return n}function dQ(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function fQ(e){return e instanceof HTMLInputElement&&"select"in e}function os(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&fQ(e)&&t&&e.select()}}var qN=hQ();function hQ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=GN(e,t),e.unshift(t)},remove(t){var n;e=GN(e,t),(n=e[0])==null||n.resume()}}}function GN(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function pQ(e){return e.filter(t=>t.tagName!=="A")}var mQ="Portal",jd=S.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[i,o]=S.useState(!1);Un(()=>o(!0),[]);const s=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?fR.createPortal(v.jsx(Ue.div,{...r,ref:t}),s):null});jd.displayName=mQ;var qv=0;function Cm(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ZN()),document.body.insertAdjacentElement("beforeend",e[1]??ZN()),qv++,()=>{qv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qv--}},[])}function ZN(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var _i=function(){return _i=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_i.apply(this,arguments)};function sO(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function gQ(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Zh="right-scroll-bar-position",Kh="width-before-scroll-bar",yQ="with-scroll-bars-hidden",vQ="--removed-body-scroll-bar-size";function Gv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function xQ(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var wQ=typeof window<"u"?S.useLayoutEffect:S.useEffect,KN=new WeakMap;function bQ(e,t){var n=xQ(null,function(r){return e.forEach(function(i){return Gv(i,r)})});return wQ(function(){var r=KN.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Gv(a,null)}),o.forEach(function(a){i.has(a)||Gv(a,s)})}KN.set(n,e)},[e]),n}function kQ(e){return e}function SQ(e,t){t===void 0&&(t=kQ);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var u=function(){var f=s;s=[],f.forEach(o)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(f){s.push(f),c()},filter:function(f){return s=s.filter(f),n}}}};return i}function EQ(e){e===void 0&&(e={});var t=SQ(null);return t.options=_i({async:!0,ssr:!1},e),t}var aO=function(e){var t=e.sideCar,n=sO(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return S.createElement(r,_i({},n))};aO.isSideCarExport=!0;function CQ(e,t){return e.useMedium(t),aO}var lO=EQ(),Zv=function(){},_m=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:Zv,onWheelCapture:Zv,onTouchMoveCapture:Zv}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,u=e.className,c=e.removeScrollBar,f=e.enabled,h=e.shards,p=e.sideCar,m=e.noIsolation,y=e.inert,x=e.allowPinchZoom,k=e.as,w=k===void 0?"div":k,E=e.gapMode,C=sO(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=p,P=bQ([n,t]),A=_i(_i({},C),i);return S.createElement(S.Fragment,null,f&&S.createElement(N,{sideCar:lO,removeScrollBar:c,shards:h,noIsolation:m,inert:y,setCallbacks:o,allowPinchZoom:!!x,lockRef:n,gapMode:E}),s?S.cloneElement(S.Children.only(a),_i(_i({},A),{ref:P})):S.createElement(w,_i({},A,{className:u,ref:P}),a))});_m.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_m.classNames={fullWidth:Kh,zeroRight:Zh};var _Q=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function NQ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_Q();return t&&e.setAttribute("nonce",t),e}function TQ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function AQ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var PQ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=NQ())&&(TQ(t,n),AQ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},RQ=function(){var e=PQ();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},uO=function(){var e=RQ(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},MQ={left:0,top:0,right:0,gap:0},Kv=function(e){return parseInt(e||"",10)||0},DQ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Kv(n),Kv(r),Kv(i)]},OQ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return MQ;var t=DQ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},IQ=uO(),bl="data-scroll-locked",jQ=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
238
+ .`.concat(yQ,` {
239
+ overflow: hidden `).concat(r,`;
240
+ padding-right: `).concat(a,"px ").concat(r,`;
241
+ }
242
+ body[`).concat(bl,`] {
243
+ overflow: hidden `).concat(r,`;
244
+ overscroll-behavior: contain;
245
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
246
+ padding-left: `.concat(i,`px;
247
+ padding-top: `).concat(o,`px;
248
+ padding-right: `).concat(s,`px;
249
+ margin-left:0;
250
+ margin-top:0;
251
+ margin-right: `).concat(a,"px ").concat(r,`;
252
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
253
+ }
254
+
255
+ .`).concat(Zh,` {
256
+ right: `).concat(a,"px ").concat(r,`;
257
+ }
258
+
259
+ .`).concat(Kh,` {
260
+ margin-right: `).concat(a,"px ").concat(r,`;
261
+ }
262
+
263
+ .`).concat(Zh," .").concat(Zh,` {
264
+ right: 0 `).concat(r,`;
265
+ }
266
+
267
+ .`).concat(Kh," .").concat(Kh,` {
268
+ margin-right: 0 `).concat(r,`;
269
+ }
270
+
271
+ body[`).concat(bl,`] {
272
+ `).concat(vQ,": ").concat(a,`px;
273
+ }
274
+ `)},XN=function(){var e=parseInt(document.body.getAttribute(bl)||"0",10);return isFinite(e)?e:0},LQ=function(){S.useEffect(function(){return document.body.setAttribute(bl,(XN()+1).toString()),function(){var e=XN()-1;e<=0?document.body.removeAttribute(bl):document.body.setAttribute(bl,e.toString())}},[])},FQ=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;LQ();var o=S.useMemo(function(){return OQ(i)},[i]);return S.createElement(IQ,{styles:jQ(o,!t,i,n?"":"!important")})},yw=!1;if(typeof window<"u")try{var Th=Object.defineProperty({},"passive",{get:function(){return yw=!0,!0}});window.addEventListener("test",Th,Th),window.removeEventListener("test",Th,Th)}catch{yw=!1}var el=yw?{passive:!1}:!1,zQ=function(e){return e.tagName==="TEXTAREA"},cO=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!zQ(e)&&n[t]==="visible")},$Q=function(e){return cO(e,"overflowY")},BQ=function(e){return cO(e,"overflowX")},QN=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=dO(e,r);if(i){var o=fO(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},VQ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},WQ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},dO=function(e,t){return e==="v"?$Q(t):BQ(t)},fO=function(e,t){return e==="v"?VQ(t):WQ(t)},UQ=function(e,t){return e==="h"&&t==="rtl"?-1:1},HQ=function(e,t,n,r,i){var o=UQ(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,u=t.contains(a),c=!1,f=s>0,h=0,p=0;do{var m=fO(e,a),y=m[0],x=m[1],k=m[2],w=x-k-o*y;(y||w)&&dO(e,a)&&(h+=w,p+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(f&&(Math.abs(h)<1||!i)||!f&&(Math.abs(p)<1||!i))&&(c=!0),c},Ah=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},JN=function(e){return[e.deltaX,e.deltaY]},eT=function(e){return e&&"current"in e?e.current:e},YQ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qQ=function(e){return`
275
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
276
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
277
+ `)},GQ=0,tl=[];function ZQ(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),i=S.useState(GQ++)[0],o=S.useState(uO)[0],s=S.useRef(e);S.useEffect(function(){s.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=gQ([e.lockRef.current],(e.shards||[]).map(eT),!0).filter(Boolean);return x.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=S.useCallback(function(x,k){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!s.current.allowPinchZoom;var w=Ah(x),E=n.current,C="deltaX"in x?x.deltaX:E[0]-w[0],N="deltaY"in x?x.deltaY:E[1]-w[1],P,A=x.target,O=Math.abs(C)>Math.abs(N)?"h":"v";if("touches"in x&&O==="h"&&A.type==="range")return!1;var M=QN(O,A);if(!M)return!0;if(M?P=O:(P=O==="v"?"h":"v",M=QN(O,A)),!M)return!1;if(!r.current&&"changedTouches"in x&&(C||N)&&(r.current=P),!P)return!0;var j=r.current||P;return HQ(j,k,x,j==="h"?C:N,!0)},[]),u=S.useCallback(function(x){var k=x;if(!(!tl.length||tl[tl.length-1]!==o)){var w="deltaY"in k?JN(k):Ah(k),E=t.current.filter(function(P){return P.name===k.type&&(P.target===k.target||k.target===P.shadowParent)&&YQ(P.delta,w)})[0];if(E&&E.should){k.cancelable&&k.preventDefault();return}if(!E){var C=(s.current.shards||[]).map(eT).filter(Boolean).filter(function(P){return P.contains(k.target)}),N=C.length>0?a(k,C[0]):!s.current.noIsolation;N&&k.cancelable&&k.preventDefault()}}},[]),c=S.useCallback(function(x,k,w,E){var C={name:x,delta:k,target:w,should:E,shadowParent:KQ(w)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(N){return N!==C})},1)},[]),f=S.useCallback(function(x){n.current=Ah(x),r.current=void 0},[]),h=S.useCallback(function(x){c(x.type,JN(x),x.target,a(x,e.lockRef.current))},[]),p=S.useCallback(function(x){c(x.type,Ah(x),x.target,a(x,e.lockRef.current))},[]);S.useEffect(function(){return tl.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",u,el),document.addEventListener("touchmove",u,el),document.addEventListener("touchstart",f,el),function(){tl=tl.filter(function(x){return x!==o}),document.removeEventListener("wheel",u,el),document.removeEventListener("touchmove",u,el),document.removeEventListener("touchstart",f,el)}},[]);var m=e.removeScrollBar,y=e.inert;return S.createElement(S.Fragment,null,y?S.createElement(o,{styles:qQ(i)}):null,m?S.createElement(FQ,{gapMode:e.gapMode}):null)}function KQ(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const XQ=CQ(lO,ZQ);var Ld=S.forwardRef(function(e,t){return S.createElement(_m,_i({},e,{ref:t,sideCar:XQ}))});Ld.classNames=_m.classNames;var QQ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},nl=new WeakMap,Ph=new WeakMap,Rh={},Xv=0,hO=function(e){return e&&(e.host||hO(e.parentNode))},JQ=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=hO(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},eJ=function(e,t,n,r){var i=JQ(t,Array.isArray(e)?e:[e]);Rh[n]||(Rh[n]=new WeakMap);var o=Rh[n],s=[],a=new Set,u=new Set(i),c=function(h){!h||a.has(h)||(a.add(h),c(h.parentNode))};i.forEach(c);var f=function(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))f(p);else try{var m=p.getAttribute(r),y=m!==null&&m!=="false",x=(nl.get(p)||0)+1,k=(o.get(p)||0)+1;nl.set(p,x),o.set(p,k),s.push(p),x===1&&y&&Ph.set(p,!0),k===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return f(t),a.clear(),Xv++,function(){s.forEach(function(h){var p=nl.get(h)-1,m=o.get(h)-1;nl.set(h,p),o.set(h,m),p||(Ph.has(h)||h.removeAttribute(r),Ph.delete(h)),m||h.removeAttribute(n)}),Xv--,Xv||(nl=new WeakMap,nl=new WeakMap,Ph=new WeakMap,Rh={})}},Nm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=QQ(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),eJ(r,i,n,"aria-hidden")):function(){return null}},P1="Dialog",[pO,mO]=Yr(P1),[tJ,gi]=pO(P1),gO=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=S.useRef(null),u=S.useRef(null),[c=!1,f]=wo({prop:r,defaultProp:i,onChange:o});return v.jsx(tJ,{scope:t,triggerRef:a,contentRef:u,contentId:En(),titleId:En(),descriptionId:En(),open:c,onOpenChange:f,onOpenToggle:S.useCallback(()=>f(h=>!h),[f]),modal:s,children:n})};gO.displayName=P1;var yO="DialogTrigger",vO=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(yO,n),o=pt(t,i.triggerRef);return v.jsx(Ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":D1(i.open),...r,ref:o,onClick:Re(e.onClick,i.onOpenToggle)})});vO.displayName=yO;var R1="DialogPortal",[nJ,xO]=pO(R1,{forceMount:void 0}),wO=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=gi(R1,t);return v.jsx(nJ,{scope:t,forceMount:n,children:S.Children.map(r,s=>v.jsx(nr,{present:n||o.open,children:v.jsx(jd,{asChild:!0,container:i,children:s})}))})};wO.displayName=R1;var bp="DialogOverlay",bO=S.forwardRef((e,t)=>{const n=xO(bp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=gi(bp,e.__scopeDialog);return o.modal?v.jsx(nr,{present:r||o.open,children:v.jsx(rJ,{...i,ref:t})}):null});bO.displayName=bp;var rJ=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(bp,n);return v.jsx(Ld,{as:Li,allowPinchZoom:!0,shards:[i.contentRef],children:v.jsx(Ue.div,{"data-state":D1(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),la="DialogContent",kO=S.forwardRef((e,t)=>{const n=xO(la,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=gi(la,e.__scopeDialog);return v.jsx(nr,{present:r||o.open,children:o.modal?v.jsx(iJ,{...i,ref:t}):v.jsx(oJ,{...i,ref:t})})});kO.displayName=la;var iJ=S.forwardRef((e,t)=>{const n=gi(la,e.__scopeDialog),r=S.useRef(null),i=pt(t,n.contentRef,r);return S.useEffect(()=>{const o=r.current;if(o)return Nm(o)},[]),v.jsx(SO,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault())})}),oJ=S.forwardRef((e,t)=>{const n=gi(la,e.__scopeDialog),r=S.useRef(!1),i=S.useRef(!1);return v.jsx(SO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),SO=S.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=gi(la,n),u=S.useRef(null),c=pt(t,u);return Cm(),v.jsxs(v.Fragment,{children:[v.jsx(Id,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:v.jsx(Od,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":D1(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),v.jsxs(v.Fragment,{children:[v.jsx(aJ,{titleId:a.titleId}),v.jsx(uJ,{contentRef:u,descriptionId:a.descriptionId})]})]})}),M1="DialogTitle",EO=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(M1,n);return v.jsx(Ue.h2,{id:i.titleId,...r,ref:t})});EO.displayName=M1;var CO="DialogDescription",_O=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(CO,n);return v.jsx(Ue.p,{id:i.descriptionId,...r,ref:t})});_O.displayName=CO;var NO="DialogClose",TO=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=gi(NO,n);return v.jsx(Ue.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>i.onOpenChange(!1))})});TO.displayName=NO;function D1(e){return e?"open":"closed"}var AO="DialogTitleWarning",[sJ,PO]=k6(AO,{contentName:la,titleName:M1,docsSlug:"dialog"}),aJ=({titleId:e})=>{const t=PO(AO),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
278
+
279
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
280
+
281
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},lJ="DialogDescriptionWarning",uJ=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${PO(lJ).contentName}}.`;return S.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},RO=gO,cJ=vO,MO=wO,DO=bO,OO=kO,dJ=EO,fJ=_O,IO=TO,jO="AlertDialog",[hJ,Sve]=Yr(jO,[mO]),To=mO(),LO=e=>{const{__scopeAlertDialog:t,...n}=e,r=To(t);return v.jsx(RO,{...r,...n,modal:!0})};LO.displayName=jO;var pJ="AlertDialogTrigger",FO=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=To(n);return v.jsx(cJ,{...i,...r,ref:t})});FO.displayName=pJ;var mJ="AlertDialogPortal",zO=e=>{const{__scopeAlertDialog:t,...n}=e,r=To(t);return v.jsx(MO,{...r,...n})};zO.displayName=mJ;var gJ="AlertDialogOverlay",$O=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=To(n);return v.jsx(DO,{...i,...r,ref:t})});$O.displayName=gJ;var kl="AlertDialogContent",[yJ,vJ]=hJ(kl),BO=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=To(n),s=S.useRef(null),a=pt(t,s),u=S.useRef(null);return v.jsx(sJ,{contentName:kl,titleName:VO,docsSlug:"alert-dialog",children:v.jsx(yJ,{scope:n,cancelRef:u,children:v.jsxs(OO,{role:"alertdialog",...o,...i,ref:a,onOpenAutoFocus:Re(i.onOpenAutoFocus,c=>{var f;c.preventDefault(),(f=u.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[v.jsx(xR,{children:r}),v.jsx(wJ,{contentRef:s})]})})})});BO.displayName=kl;var VO="AlertDialogTitle",WO=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=To(n);return v.jsx(dJ,{...i,...r,ref:t})});WO.displayName=VO;var UO="AlertDialogDescription",HO=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=To(n);return v.jsx(fJ,{...i,...r,ref:t})});HO.displayName=UO;var xJ="AlertDialogAction",YO=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=To(n);return v.jsx(IO,{...i,...r,ref:t})});YO.displayName=xJ;var qO="AlertDialogCancel",GO=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=vJ(qO,n),o=To(n),s=pt(t,i);return v.jsx(IO,{...o,...r,ref:s})});GO.displayName=qO;var wJ=({contentRef:e})=>{const t=`\`${kl}\` requires a description for the component to be accessible for screen reader users.
282
+
283
+ You can add a description to the \`${kl}\` by passing a \`${UO}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
284
+
285
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${kl}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
286
+
287
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return S.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},bJ=LO,kJ=FO,SJ=zO,ZO=$O,KO=BO,XO=YO,QO=GO,JO=WO,eI=HO;const EJ=bJ,CJ=kJ,tI=SJ;function An({open:e,onOpenChange:t,children:n}){return v.jsx(EJ,{open:e,onOpenChange:t,children:n})}const O1=S.forwardRef(({className:e,...t},n)=>v.jsx(ZO,{className:Te("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));O1.displayName=ZO.displayName;const nI=S.forwardRef(({className:e,...t},n)=>v.jsxs(tI,{children:[v.jsx(O1,{}),v.jsx(KO,{ref:n,className:Te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));nI.displayName=KO.displayName;const rI=({className:e,...t})=>v.jsx("div",{className:Te("flex flex-col space-y-2 text-center sm:text-left",e),...t});rI.displayName="AlertDialogHeader";const iI=({className:e,...t})=>v.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});iI.displayName="AlertDialogFooter";const oI=S.forwardRef(({className:e,...t},n)=>v.jsx(JO,{ref:n,className:Te("text-lg font-semibold",e),...t}));oI.displayName=JO.displayName;const sI=S.forwardRef(({className:e,...t},n)=>v.jsx(eI,{ref:n,className:Te("text-sm text-muted-foreground",e),...t}));sI.displayName=eI.displayName;const aI=S.forwardRef(({className:e,...t},n)=>v.jsx(XO,{ref:n,className:Te(xl(),e),...t}));aI.displayName=XO.displayName;const lI=S.forwardRef(({className:e,...t},n)=>v.jsx(QO,{ref:n,className:Te(xl({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));lI.displayName=QO.displayName;An.Trigger=CJ;An.Portal=tI;An.Overlay=O1;An.Content=nI;An.Header=rI;An.Footer=iI;An.Title=oI;An.Description=sI;An.Action=aI;An.Cancel=lI;const _J=["top","right","bottom","left"],ps=Math.min,kr=Math.max,kp=Math.round,Mh=Math.floor,Di=e=>({x:e,y:e}),NJ={left:"right",right:"left",bottom:"top",top:"bottom"},TJ={start:"end",end:"start"};function vw(e,t,n){return kr(e,ps(t,n))}function bo(e,t){return typeof e=="function"?e(t):e}function ko(e){return e.split("-")[0]}function su(e){return e.split("-")[1]}function I1(e){return e==="x"?"y":"x"}function j1(e){return e==="y"?"height":"width"}function ms(e){return["top","bottom"].includes(ko(e))?"y":"x"}function L1(e){return I1(ms(e))}function AJ(e,t,n){n===void 0&&(n=!1);const r=su(e),i=L1(e),o=j1(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Sp(s)),[s,Sp(s)]}function PJ(e){const t=Sp(e);return[xw(e),t,xw(t)]}function xw(e){return e.replace(/start|end/g,t=>TJ[t])}function RJ(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function MJ(e,t,n,r){const i=su(e);let o=RJ(ko(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(xw)))),o}function Sp(e){return e.replace(/left|right|bottom|top/g,t=>NJ[t])}function DJ(e){return{top:0,right:0,bottom:0,left:0,...e}}function uI(e){return typeof e!="number"?DJ(e):{top:e,right:e,bottom:e,left:e}}function Ep(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function tT(e,t,n){let{reference:r,floating:i}=e;const o=ms(t),s=L1(t),a=j1(s),u=ko(t),c=o==="y",f=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let m;switch(u){case"top":m={x:f,y:r.y-i.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-i.width,y:h};break;default:m={x:r.x,y:r.y}}switch(su(t)){case"start":m[s]-=p*(n&&c?-1:1);break;case"end":m[s]+=p*(n&&c?-1:1);break}return m}const OJ=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:h}=tT(c,r,u),p=r,m={},y=0;for(let x=0;x<a.length;x++){const{name:k,fn:w}=a[x],{x:E,y:C,data:N,reset:P}=await w({x:f,y:h,initialPlacement:r,placement:p,strategy:i,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});f=E??f,h=C??h,m={...m,[k]:{...m[k],...N}},P&&y<=50&&(y++,typeof P=="object"&&(P.placement&&(p=P.placement),P.rects&&(c=P.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):P.rects),{x:f,y:h}=tT(c,p,u)),x=-1)}return{x:f,y:h,placement:p,strategy:i,middlewareData:m}};async function Hc(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:p=!1,padding:m=0}=bo(t,e),y=uI(m),k=a[p?h==="floating"?"reference":"floating":h],w=Ep(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(k)))==null||n?k:k.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:u})),E=h==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),N=await(o.isElement==null?void 0:o.isElement(C))?await(o.getScale==null?void 0:o.getScale(C))||{x:1,y:1}:{x:1,y:1},P=Ep(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:C,strategy:u}):E);return{top:(w.top-P.top+y.top)/N.y,bottom:(P.bottom-w.bottom+y.bottom)/N.y,left:(w.left-P.left+y.left)/N.x,right:(P.right-w.right+y.right)/N.x}}const IJ=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:u}=t,{element:c,padding:f=0}=bo(e,t)||{};if(c==null)return{};const h=uI(f),p={x:n,y:r},m=L1(i),y=j1(m),x=await s.getDimensions(c),k=m==="y",w=k?"top":"left",E=k?"bottom":"right",C=k?"clientHeight":"clientWidth",N=o.reference[y]+o.reference[m]-p[m]-o.floating[y],P=p[m]-o.reference[m],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let O=A?A[C]:0;(!O||!await(s.isElement==null?void 0:s.isElement(A)))&&(O=a.floating[C]||o.floating[y]);const M=N/2-P/2,j=O/2-x[y]/2-1,R=ps(h[w],j),$=ps(h[E],j),F=R,H=O-x[y]-$,I=O/2-x[y]/2+M,Y=vw(F,I,H),q=!u.arrow&&su(i)!=null&&I!==Y&&o.reference[y]/2-(I<F?R:$)-x[y]/2<0,Z=q?I<F?I-F:I-H:0;return{[m]:p[m]+Z,data:{[m]:Y,centerOffset:I-Y-Z,...q&&{alignmentOffset:Z}},reset:q}}}),jJ=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:x=!0,...k}=bo(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=ko(i),E=ms(a),C=ko(a)===a,N=await(u.isRTL==null?void 0:u.isRTL(c.floating)),P=p||(C||!x?[Sp(a)]:PJ(a)),A=y!=="none";!p&&A&&P.push(...MJ(a,x,y,N));const O=[a,...P],M=await Hc(t,k),j=[];let R=((r=o.flip)==null?void 0:r.overflows)||[];if(f&&j.push(M[w]),h){const I=AJ(i,s,N);j.push(M[I[0]],M[I[1]])}if(R=[...R,{placement:i,overflows:j}],!j.every(I=>I<=0)){var $,F;const I=((($=o.flip)==null?void 0:$.index)||0)+1,Y=O[I];if(Y)return{data:{index:I,overflows:R},reset:{placement:Y}};let q=(F=R.filter(Z=>Z.overflows[0]<=0).sort((Z,B)=>Z.overflows[1]-B.overflows[1])[0])==null?void 0:F.placement;if(!q)switch(m){case"bestFit":{var H;const Z=(H=R.filter(B=>{if(A){const W=ms(B.placement);return W===E||W==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(W=>W>0).reduce((W,L)=>W+L,0)]).sort((B,W)=>B[1]-W[1])[0])==null?void 0:H[0];Z&&(q=Z);break}case"initialPlacement":q=a;break}if(i!==q)return{reset:{placement:q}}}return{}}}};function nT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rT(e){return _J.some(t=>e[t]>=0)}const LJ=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=bo(e,t);switch(r){case"referenceHidden":{const o=await Hc(t,{...i,elementContext:"reference"}),s=nT(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:rT(s)}}}case"escaped":{const o=await Hc(t,{...i,altBoundary:!0}),s=nT(o,n.floating);return{data:{escapedOffsets:s,escaped:rT(s)}}}default:return{}}}}};async function FJ(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=ko(n),a=su(n),u=ms(n)==="y",c=["left","top"].includes(s)?-1:1,f=o&&u?-1:1,h=bo(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof y=="number"&&(m=a==="end"?y*-1:y),u?{x:m*f,y:p*c}:{x:p*c,y:m*f}}const zJ=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,u=await FJ(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:s}}}}},$J=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:k=>{let{x:w,y:E}=k;return{x:w,y:E}}},...u}=bo(e,t),c={x:n,y:r},f=await Hc(t,u),h=ms(ko(i)),p=I1(h);let m=c[p],y=c[h];if(o){const k=p==="y"?"top":"left",w=p==="y"?"bottom":"right",E=m+f[k],C=m-f[w];m=vw(E,m,C)}if(s){const k=h==="y"?"top":"left",w=h==="y"?"bottom":"right",E=y+f[k],C=y-f[w];y=vw(E,y,C)}const x=a.fn({...t,[p]:m,[h]:y});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[p]:o,[h]:s}}}}}},BJ=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:u=!0,crossAxis:c=!0}=bo(e,t),f={x:n,y:r},h=ms(i),p=I1(h);let m=f[p],y=f[h];const x=bo(a,t),k=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const C=p==="y"?"height":"width",N=o.reference[p]-o.floating[C]+k.mainAxis,P=o.reference[p]+o.reference[C]-k.mainAxis;m<N?m=N:m>P&&(m=P)}if(c){var w,E;const C=p==="y"?"width":"height",N=["top","left"].includes(ko(i)),P=o.reference[h]-o.floating[C]+(N&&((w=s.offset)==null?void 0:w[h])||0)+(N?0:k.crossAxis),A=o.reference[h]+o.reference[C]+(N?0:((E=s.offset)==null?void 0:E[h])||0)-(N?k.crossAxis:0);y<P?y=P:y>A&&(y=A)}return{[p]:m,[h]:y}}}},VJ=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:u=()=>{},...c}=bo(e,t),f=await Hc(t,c),h=ko(i),p=su(i),m=ms(i)==="y",{width:y,height:x}=o.floating;let k,w;h==="top"||h==="bottom"?(k=h,w=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(w=h,k=p==="end"?"top":"bottom");const E=x-f.top-f.bottom,C=y-f.left-f.right,N=ps(x-f[k],E),P=ps(y-f[w],C),A=!t.middlewareData.shift;let O=N,M=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=E),A&&!p){const R=kr(f.left,0),$=kr(f.right,0),F=kr(f.top,0),H=kr(f.bottom,0);m?M=y-2*(R!==0||$!==0?R+$:kr(f.left,f.right)):O=x-2*(F!==0||H!==0?F+H:kr(f.top,f.bottom))}await u({...t,availableWidth:M,availableHeight:O});const j=await s.getDimensions(a.floating);return y!==j.width||x!==j.height?{reset:{rects:!0}}:{}}}};function Tm(){return typeof window<"u"}function au(e){return cI(e)?(e.nodeName||"").toLowerCase():"#document"}function Nr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ui(e){var t;return(t=(cI(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function cI(e){return Tm()?e instanceof Node||e instanceof Nr(e).Node:!1}function di(e){return Tm()?e instanceof Element||e instanceof Nr(e).Element:!1}function Fi(e){return Tm()?e instanceof HTMLElement||e instanceof Nr(e).HTMLElement:!1}function iT(e){return!Tm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Nr(e).ShadowRoot}function Fd(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=fi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function WJ(e){return["table","td","th"].includes(au(e))}function Am(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function F1(e){const t=z1(),n=di(e)?fi(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function UJ(e){let t=gs(e);for(;Fi(t)&&!Dl(t);){if(F1(t))return t;if(Am(t))return null;t=gs(t)}return null}function z1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Dl(e){return["html","body","#document"].includes(au(e))}function fi(e){return Nr(e).getComputedStyle(e)}function Pm(e){return di(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gs(e){if(au(e)==="html")return e;const t=e.assignedSlot||e.parentNode||iT(e)&&e.host||Ui(e);return iT(t)?t.host:t}function dI(e){const t=gs(e);return Dl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fi(t)&&Fd(t)?t:dI(t)}function Yc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=dI(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Nr(i);if(o){const a=ww(s);return t.concat(s,s.visualViewport||[],Fd(i)?i:[],a&&n?Yc(a):[])}return t.concat(i,Yc(i,[],n))}function ww(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fI(e){const t=fi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Fi(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=kp(n)!==o||kp(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function $1(e){return di(e)?e:e.contextElement}function Sl(e){const t=$1(e);if(!Fi(t))return Di(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=fI(t);let s=(o?kp(n.width):n.width)/r,a=(o?kp(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const HJ=Di(0);function hI(e){const t=Nr(e);return!z1()||!t.visualViewport?HJ:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function YJ(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Nr(e)?!1:t}function ua(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=$1(e);let s=Di(1);t&&(r?di(r)&&(s=Sl(r)):s=Sl(e));const a=YJ(o,n,r)?hI(o):Di(0);let u=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,f=i.width/s.x,h=i.height/s.y;if(o){const p=Nr(o),m=r&&di(r)?Nr(r):r;let y=p,x=ww(y);for(;x&&r&&m!==y;){const k=Sl(x),w=x.getBoundingClientRect(),E=fi(x),C=w.left+(x.clientLeft+parseFloat(E.paddingLeft))*k.x,N=w.top+(x.clientTop+parseFloat(E.paddingTop))*k.y;u*=k.x,c*=k.y,f*=k.x,h*=k.y,u+=C,c+=N,y=Nr(x),x=ww(y)}}return Ep({width:f,height:h,x:u,y:c})}function B1(e,t){const n=Pm(e).scrollLeft;return t?t.left+n:ua(Ui(e)).left+n}function pI(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:B1(e,r)),o=r.top+t.scrollTop;return{x:i,y:o}}function qJ(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Ui(r),a=t?Am(t.floating):!1;if(r===s||a&&o)return n;let u={scrollLeft:0,scrollTop:0},c=Di(1);const f=Di(0),h=Fi(r);if((h||!h&&!o)&&((au(r)!=="body"||Fd(s))&&(u=Pm(r)),Fi(r))){const m=ua(r);c=Sl(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const p=s&&!h&&!o?pI(s,u,!0):Di(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-u.scrollTop*c.y+f.y+p.y}}function GJ(e){return Array.from(e.getClientRects())}function ZJ(e){const t=Ui(e),n=Pm(e),r=e.ownerDocument.body,i=kr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=kr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+B1(e);const a=-n.scrollTop;return fi(r).direction==="rtl"&&(s+=kr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function KJ(e,t){const n=Nr(e),r=Ui(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,u=0;if(i){o=i.width,s=i.height;const c=z1();(!c||c&&t==="fixed")&&(a=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:a,y:u}}function XJ(e,t){const n=ua(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Fi(e)?Sl(e):Di(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,u=i*o.x,c=r*o.y;return{width:s,height:a,x:u,y:c}}function oT(e,t,n){let r;if(t==="viewport")r=KJ(e,n);else if(t==="document")r=ZJ(Ui(e));else if(di(t))r=XJ(t,n);else{const i=hI(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ep(r)}function mI(e,t){const n=gs(e);return n===t||!di(n)||Dl(n)?!1:fi(n).position==="fixed"||mI(n,t)}function QJ(e,t){const n=t.get(e);if(n)return n;let r=Yc(e,[],!1).filter(a=>di(a)&&au(a)!=="body"),i=null;const o=fi(e).position==="fixed";let s=o?gs(e):e;for(;di(s)&&!Dl(s);){const a=fi(s),u=F1(s);!u&&a.position==="fixed"&&(i=null),(o?!u&&!i:!u&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Fd(s)&&!u&&mI(e,s))?r=r.filter(f=>f!==s):i=a,s=gs(s)}return t.set(e,r),r}function JJ(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?Am(t)?[]:QJ(t,this._c):[].concat(n),r],a=s[0],u=s.reduce((c,f)=>{const h=oT(t,f,i);return c.top=kr(h.top,c.top),c.right=ps(h.right,c.right),c.bottom=ps(h.bottom,c.bottom),c.left=kr(h.left,c.left),c},oT(t,a,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function eee(e){const{width:t,height:n}=fI(e);return{width:t,height:n}}function tee(e,t,n){const r=Fi(t),i=Ui(t),o=n==="fixed",s=ua(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const u=Di(0);if(r||!r&&!o)if((au(t)!=="body"||Fd(i))&&(a=Pm(t)),r){const p=ua(t,!0,o,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else i&&(u.x=B1(i));const c=i&&!r&&!o?pI(i,a):Di(0),f=s.left+a.scrollLeft-u.x-c.x,h=s.top+a.scrollTop-u.y-c.y;return{x:f,y:h,width:s.width,height:s.height}}function Qv(e){return fi(e).position==="static"}function sT(e,t){if(!Fi(e)||fi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ui(e)===n&&(n=n.ownerDocument.body),n}function gI(e,t){const n=Nr(e);if(Am(e))return n;if(!Fi(e)){let i=gs(e);for(;i&&!Dl(i);){if(di(i)&&!Qv(i))return i;i=gs(i)}return n}let r=sT(e,t);for(;r&&WJ(r)&&Qv(r);)r=sT(r,t);return r&&Dl(r)&&Qv(r)&&!F1(r)?n:r||UJ(e)||n}const nee=async function(e){const t=this.getOffsetParent||gI,n=this.getDimensions,r=await n(e.floating);return{reference:tee(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ree(e){return fi(e).direction==="rtl"}const iee={convertOffsetParentRelativeRectToViewportRelativeRect:qJ,getDocumentElement:Ui,getClippingRect:JJ,getOffsetParent:gI,getElementRects:nee,getClientRects:GJ,getDimensions:eee,getScale:Sl,isElement:di,isRTL:ree};function oee(e,t){let n=null,r;const i=Ui(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),o();const{left:c,top:f,width:h,height:p}=e.getBoundingClientRect();if(a||t(),!h||!p)return;const m=Mh(f),y=Mh(i.clientWidth-(c+h)),x=Mh(i.clientHeight-(f+p)),k=Mh(c),E={rootMargin:-m+"px "+-y+"px "+-x+"px "+-k+"px",threshold:kr(0,ps(1,u))||1};let C=!0;function N(P){const A=P[0].intersectionRatio;if(A!==u){if(!C)return s();A?s(!1,A):r=setTimeout(()=>{s(!1,1e-7)},1e3)}C=!1}try{n=new IntersectionObserver(N,{...E,root:i.ownerDocument})}catch{n=new IntersectionObserver(N,E)}n.observe(e)}return s(!0),o}function see(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,c=$1(e),f=i||o?[...c?Yc(c):[],...Yc(t)]:[];f.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const h=c&&a?oee(c,n):null;let p=-1,m=null;s&&(m=new ResizeObserver(w=>{let[E]=w;E&&E.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var C;(C=m)==null||C.observe(t)})),n()}),c&&!u&&m.observe(c),m.observe(t));let y,x=u?ua(e):null;u&&k();function k(){const w=ua(e);x&&(w.x!==x.x||w.y!==x.y||w.width!==x.width||w.height!==x.height)&&n(),x=w,y=requestAnimationFrame(k)}return n(),()=>{var w;f.forEach(E=>{i&&E.removeEventListener("scroll",n),o&&E.removeEventListener("resize",n)}),h==null||h(),(w=m)==null||w.disconnect(),m=null,u&&cancelAnimationFrame(y)}}const aee=zJ,lee=$J,uee=jJ,cee=VJ,dee=LJ,aT=IJ,fee=BJ,hee=(e,t,n)=>{const r=new Map,i={platform:iee,...n},o={...i.platform,_c:r};return OJ(e,t,{...i,platform:o})};var Xh=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Cp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Cp(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Cp(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function yI(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lT(e,t){const n=yI(e);return Math.round(t*n)/n}function Jv(e){const t=S.useRef(e);return Xh(()=>{t.current=e}),t}function pee(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[f,h]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=S.useState(r);Cp(p,r)||m(r);const[y,x]=S.useState(null),[k,w]=S.useState(null),E=S.useCallback(B=>{B!==A.current&&(A.current=B,x(B))},[]),C=S.useCallback(B=>{B!==O.current&&(O.current=B,w(B))},[]),N=o||y,P=s||k,A=S.useRef(null),O=S.useRef(null),M=S.useRef(f),j=u!=null,R=Jv(u),$=Jv(i),F=Jv(c),H=S.useCallback(()=>{if(!A.current||!O.current)return;const B={placement:t,strategy:n,middleware:p};$.current&&(B.platform=$.current),hee(A.current,O.current,B).then(W=>{const L={...W,isPositioned:F.current!==!1};I.current&&!Cp(M.current,L)&&(M.current=L,eu.flushSync(()=>{h(L)}))})},[p,t,n,$,F]);Xh(()=>{c===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,h(B=>({...B,isPositioned:!1})))},[c]);const I=S.useRef(!1);Xh(()=>(I.current=!0,()=>{I.current=!1}),[]),Xh(()=>{if(N&&(A.current=N),P&&(O.current=P),N&&P){if(R.current)return R.current(N,P,H);H()}},[N,P,H,R,j]);const Y=S.useMemo(()=>({reference:A,floating:O,setReference:E,setFloating:C}),[E,C]),q=S.useMemo(()=>({reference:N,floating:P}),[N,P]),Z=S.useMemo(()=>{const B={position:n,left:0,top:0};if(!q.floating)return B;const W=lT(q.floating,f.x),L=lT(q.floating,f.y);return a?{...B,transform:"translate("+W+"px, "+L+"px)",...yI(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:L}},[n,a,q.floating,f.x,f.y]);return S.useMemo(()=>({...f,update:H,refs:Y,elements:q,floatingStyles:Z}),[f,H,Y,q,Z])}const mee=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?aT({element:r.current,padding:i}).fn(n):{}:r?aT({element:r,padding:i}).fn(n):{}}}},gee=(e,t)=>({...aee(e),options:[e,t]}),yee=(e,t)=>({...lee(e),options:[e,t]}),vee=(e,t)=>({...fee(e),options:[e,t]}),xee=(e,t)=>({...uee(e),options:[e,t]}),wee=(e,t)=>({...cee(e),options:[e,t]}),bee=(e,t)=>({...dee(e),options:[e,t]}),kee=(e,t)=>({...mee(e),options:[e,t]});var See="Arrow",vI=S.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return v.jsx(Ue.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});vI.displayName=See;var Eee=vI;function xI(e){const[t,n]=S.useState(void 0);return Un(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const u=o.borderBoxSize,c=Array.isArray(u)?u[0]:u;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var V1="Popper",[wI,lu]=Yr(V1),[Cee,bI]=wI(V1),kI=e=>{const{__scopePopper:t,children:n}=e,[r,i]=S.useState(null);return v.jsx(Cee,{scope:t,anchor:r,onAnchorChange:i,children:n})};kI.displayName=V1;var SI="PopperAnchor",EI=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=bI(SI,n),s=S.useRef(null),a=pt(t,s);return S.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:v.jsx(Ue.div,{...i,ref:a})});EI.displayName=SI;var W1="PopperContent",[_ee,Nee]=wI(W1),CI=S.forwardRef((e,t)=>{var ee,re,ue,he,be,fe;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:y,...x}=e,k=bI(W1,n),[w,E]=S.useState(null),C=pt(t,ve=>E(ve)),[N,P]=S.useState(null),A=xI(N),O=(A==null?void 0:A.width)??0,M=(A==null?void 0:A.height)??0,j=r+(o!=="center"?"-"+o:""),R=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},$=Array.isArray(c)?c:[c],F=$.length>0,H={padding:R,boundary:$.filter(Aee),altBoundary:F},{refs:I,floatingStyles:Y,placement:q,isPositioned:Z,middlewareData:B}=pee({strategy:"fixed",placement:j,whileElementsMounted:(...ve)=>see(...ve,{animationFrame:m==="always"}),elements:{reference:k.anchor},middleware:[gee({mainAxis:i+M,alignmentAxis:s}),u&&yee({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?vee():void 0,...H}),u&&xee({...H}),wee({...H,apply:({elements:ve,rects:Me,availableWidth:$e,availableHeight:ct})=>{const{width:_t,height:Q}=Me.reference,oe=ve.floating.style;oe.setProperty("--radix-popper-available-width",`${$e}px`),oe.setProperty("--radix-popper-available-height",`${ct}px`),oe.setProperty("--radix-popper-anchor-width",`${_t}px`),oe.setProperty("--radix-popper-anchor-height",`${Q}px`)}}),N&&kee({element:N,padding:a}),Pee({arrowWidth:O,arrowHeight:M}),p&&bee({strategy:"referenceHidden",...H})]}),[W,L]=TI(q),U=fn(y);Un(()=>{Z&&(U==null||U())},[Z,U]);const V=(ee=B.arrow)==null?void 0:ee.x,D=(re=B.arrow)==null?void 0:re.y,G=((ue=B.arrow)==null?void 0:ue.centerOffset)!==0,[K,J]=S.useState();return Un(()=>{w&&J(window.getComputedStyle(w).zIndex)},[w]),v.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:Z?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(he=B.transformOrigin)==null?void 0:he.x,(be=B.transformOrigin)==null?void 0:be.y].join(" "),...((fe=B.hide)==null?void 0:fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(_ee,{scope:n,placedSide:W,onArrowChange:P,arrowX:V,arrowY:D,shouldHideArrow:G,children:v.jsx(Ue.div,{"data-side":W,"data-align":L,...x,ref:C,style:{...x.style,animation:Z?void 0:"none"}})})})});CI.displayName=W1;var _I="PopperArrow",Tee={top:"bottom",right:"left",bottom:"top",left:"right"},NI=S.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Nee(_I,r),s=Tee[o.placedSide];return v.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:v.jsx(Eee,{...i,ref:n,style:{...i.style,display:"block"}})})});NI.displayName=_I;function Aee(e){return e!==null}var Pee=e=>({name:"transformOrigin",options:e,fn(t){var k,w,E;const{placement:n,rects:r,middlewareData:i}=t,s=((k=i.arrow)==null?void 0:k.centerOffset)!==0,a=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[c,f]=TI(n),h={start:"0%",center:"50%",end:"100%"}[f],p=(((w=i.arrow)==null?void 0:w.x)??0)+a/2,m=(((E=i.arrow)==null?void 0:E.y)??0)+u/2;let y="",x="";return c==="bottom"?(y=s?h:`${p}px`,x=`${-u}px`):c==="top"?(y=s?h:`${p}px`,x=`${r.floating.height+u}px`):c==="right"?(y=`${-u}px`,x=s?h:`${m}px`):c==="left"&&(y=`${r.floating.width+u}px`,x=s?h:`${m}px`),{data:{x:y,y:x}}}});function TI(e){const[t,n="center"]=e.split("-");return[t,n]}var Rm=kI,Mm=EI,U1=CI,H1=NI,bw=["Enter"," "],Ree=["ArrowDown","PageUp","Home"],AI=["ArrowUp","PageDown","End"],Mee=[...Ree,...AI],Dee={ltr:[...bw,"ArrowRight"],rtl:[...bw,"ArrowLeft"]},Oee={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zd="Menu",[qc,Iee,jee]=_1(zd),[ba,PI]=Yr(zd,[jee,lu,Em]),$d=lu(),RI=Em(),[MI,Cs]=ba(zd),[Lee,Bd]=ba(zd),DI=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=$d(t),[u,c]=S.useState(null),f=S.useRef(!1),h=fn(o),p=Cd(i);return S.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),v.jsx(Rm,{...a,children:v.jsx(MI,{scope:t,open:n,onOpenChange:h,content:u,onContentChange:c,children:v.jsx(Lee,{scope:t,onClose:S.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:p,modal:s,children:r})})})};DI.displayName=zd;var Fee="MenuAnchor",Y1=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=$d(n);return v.jsx(Mm,{...i,...r,ref:t})});Y1.displayName=Fee;var q1="MenuPortal",[zee,OI]=ba(q1,{forceMount:void 0}),II=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=Cs(q1,t);return v.jsx(zee,{scope:t,forceMount:n,children:v.jsx(nr,{present:n||o.open,children:v.jsx(jd,{asChild:!0,container:i,children:r})})})};II.displayName=q1;var Ur="MenuContent",[$ee,G1]=ba(Ur),jI=S.forwardRef((e,t)=>{const n=OI(Ur,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Cs(Ur,e.__scopeMenu),s=Bd(Ur,e.__scopeMenu);return v.jsx(qc.Provider,{scope:e.__scopeMenu,children:v.jsx(nr,{present:r||o.open,children:v.jsx(qc.Slot,{scope:e.__scopeMenu,children:s.modal?v.jsx(Bee,{...i,ref:t}):v.jsx(Vee,{...i,ref:t})})})})}),Bee=S.forwardRef((e,t)=>{const n=Cs(Ur,e.__scopeMenu),r=S.useRef(null),i=pt(t,r);return S.useEffect(()=>{const o=r.current;if(o)return Nm(o)},[]),v.jsx(Z1,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Vee=S.forwardRef((e,t)=>{const n=Cs(Ur,e.__scopeMenu);return v.jsx(Z1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Z1=S.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:u,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,onDismiss:m,disableOutsideScroll:y,...x}=e,k=Cs(Ur,n),w=Bd(Ur,n),E=$d(n),C=RI(n),N=Iee(n),[P,A]=S.useState(null),O=S.useRef(null),M=pt(t,O,k.onContentChange),j=S.useRef(0),R=S.useRef(""),$=S.useRef(0),F=S.useRef(null),H=S.useRef("right"),I=S.useRef(0),Y=y?Ld:S.Fragment,q=y?{as:Li,allowPinchZoom:!0}:void 0,Z=W=>{var ee,re;const L=R.current+W,U=N().filter(ue=>!ue.disabled),V=document.activeElement,D=(ee=U.find(ue=>ue.ref.current===V))==null?void 0:ee.textValue,G=U.map(ue=>ue.textValue),K=ete(G,L,D),J=(re=U.find(ue=>ue.textValue===K))==null?void 0:re.ref.current;(function ue(he){R.current=he,window.clearTimeout(j.current),he!==""&&(j.current=window.setTimeout(()=>ue(""),1e3))})(L),J&&setTimeout(()=>J.focus())};S.useEffect(()=>()=>window.clearTimeout(j.current),[]),Cm();const B=S.useCallback(W=>{var U,V;return H.current===((U=F.current)==null?void 0:U.side)&&nte(W,(V=F.current)==null?void 0:V.area)},[]);return v.jsx($ee,{scope:n,searchRef:R,onItemEnter:S.useCallback(W=>{B(W)&&W.preventDefault()},[B]),onItemLeave:S.useCallback(W=>{var L;B(W)||((L=O.current)==null||L.focus(),A(null))},[B]),onTriggerLeave:S.useCallback(W=>{B(W)&&W.preventDefault()},[B]),pointerGraceTimerRef:$,onPointerGraceIntentChange:S.useCallback(W=>{F.current=W},[]),children:v.jsx(Y,{...q,children:v.jsx(Id,{asChild:!0,trapped:i,onMountAutoFocus:Re(o,W=>{var L;W.preventDefault(),(L=O.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:v.jsx(Od,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:p,onDismiss:m,children:v.jsx($D,{asChild:!0,...C,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:P,onCurrentTabStopIdChange:A,onEntryFocus:Re(u,W=>{w.isUsingKeyboardRef.current||W.preventDefault()}),preventScrollOnEntryFocus:!0,children:v.jsx(U1,{role:"menu","aria-orientation":"vertical","data-state":JI(k.open),"data-radix-menu-content":"",dir:w.dir,...E,...x,ref:M,style:{outline:"none",...x.style},onKeyDown:Re(x.onKeyDown,W=>{const U=W.target.closest("[data-radix-menu-content]")===W.currentTarget,V=W.ctrlKey||W.altKey||W.metaKey,D=W.key.length===1;U&&(W.key==="Tab"&&W.preventDefault(),!V&&D&&Z(W.key));const G=O.current;if(W.target!==G||!Mee.includes(W.key))return;W.preventDefault();const J=N().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);AI.includes(W.key)&&J.reverse(),Qee(J)}),onBlur:Re(e.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(j.current),R.current="")}),onPointerMove:Re(e.onPointerMove,Gc(W=>{const L=W.target,U=I.current!==W.clientX;if(W.currentTarget.contains(L)&&U){const V=W.clientX>I.current?"right":"left";H.current=V,I.current=W.clientX}}))})})})})})})});jI.displayName=Ur;var Wee="MenuGroup",K1=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(Ue.div,{role:"group",...r,ref:t})});K1.displayName=Wee;var Uee="MenuLabel",LI=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(Ue.div,{...r,ref:t})});LI.displayName=Uee;var _p="MenuItem",uT="menu.itemSelect",Dm=S.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=S.useRef(null),s=Bd(_p,e.__scopeMenu),a=G1(_p,e.__scopeMenu),u=pt(t,o),c=S.useRef(!1),f=()=>{const h=o.current;if(!n&&h){const p=new CustomEvent(uT,{bubbles:!0,cancelable:!0});h.addEventListener(uT,m=>r==null?void 0:r(m),{once:!0}),wR(h,p),p.defaultPrevented?c.current=!1:s.onClose()}};return v.jsx(FI,{...i,ref:u,disabled:n,onClick:Re(e.onClick,f),onPointerDown:h=>{var p;(p=e.onPointerDown)==null||p.call(e,h),c.current=!0},onPointerUp:Re(e.onPointerUp,h=>{var p;c.current||(p=h.currentTarget)==null||p.click()}),onKeyDown:Re(e.onKeyDown,h=>{const p=a.searchRef.current!=="";n||p&&h.key===" "||bw.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Dm.displayName=_p;var FI=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=G1(_p,n),a=RI(n),u=S.useRef(null),c=pt(t,u),[f,h]=S.useState(!1),[p,m]=S.useState("");return S.useEffect(()=>{const y=u.current;y&&m((y.textContent??"").trim())},[o.children]),v.jsx(qc.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:v.jsx(BD,{asChild:!0,...a,focusable:!r,children:v.jsx(Ue.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:c,onPointerMove:Re(e.onPointerMove,Gc(y=>{r?s.onItemLeave(y):(s.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,Gc(y=>s.onItemLeave(y))),onFocus:Re(e.onFocus,()=>h(!0)),onBlur:Re(e.onBlur,()=>h(!1))})})})}),Hee="MenuCheckboxItem",zI=S.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return v.jsx(UI,{scope:e.__scopeMenu,checked:n,children:v.jsx(Dm,{role:"menuitemcheckbox","aria-checked":Np(n)?"mixed":n,...i,ref:t,"data-state":J1(n),onSelect:Re(i.onSelect,()=>r==null?void 0:r(Np(n)?!0:!n),{checkForDefaultPrevented:!1})})})});zI.displayName=Hee;var $I="MenuRadioGroup",[Yee,qee]=ba($I,{value:void 0,onValueChange:()=>{}}),BI=S.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=fn(r);return v.jsx(Yee,{scope:e.__scopeMenu,value:n,onValueChange:o,children:v.jsx(K1,{...i,ref:t})})});BI.displayName=$I;var VI="MenuRadioItem",WI=S.forwardRef((e,t)=>{const{value:n,...r}=e,i=qee(VI,e.__scopeMenu),o=n===i.value;return v.jsx(UI,{scope:e.__scopeMenu,checked:o,children:v.jsx(Dm,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":J1(o),onSelect:Re(r.onSelect,()=>{var s;return(s=i.onValueChange)==null?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})})});WI.displayName=VI;var X1="MenuItemIndicator",[UI,Gee]=ba(X1,{checked:!1}),HI=S.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=Gee(X1,n);return v.jsx(nr,{present:r||Np(o.checked)||o.checked===!0,children:v.jsx(Ue.span,{...i,ref:t,"data-state":J1(o.checked)})})});HI.displayName=X1;var Zee="MenuSeparator",YI=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(Ue.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});YI.displayName=Zee;var Kee="MenuArrow",qI=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=$d(n);return v.jsx(H1,{...i,...r,ref:t})});qI.displayName=Kee;var Q1="MenuSub",[Xee,GI]=ba(Q1),ZI=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,o=Cs(Q1,t),s=$d(t),[a,u]=S.useState(null),[c,f]=S.useState(null),h=fn(i);return S.useEffect(()=>(o.open===!1&&h(!1),()=>h(!1)),[o.open,h]),v.jsx(Rm,{...s,children:v.jsx(MI,{scope:t,open:r,onOpenChange:h,content:c,onContentChange:f,children:v.jsx(Xee,{scope:t,contentId:En(),triggerId:En(),trigger:a,onTriggerChange:u,children:n})})})};ZI.displayName=Q1;var pc="MenuSubTrigger",KI=S.forwardRef((e,t)=>{const n=Cs(pc,e.__scopeMenu),r=Bd(pc,e.__scopeMenu),i=GI(pc,e.__scopeMenu),o=G1(pc,e.__scopeMenu),s=S.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:u}=o,c={__scopeMenu:e.__scopeMenu},f=S.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return S.useEffect(()=>f,[f]),S.useEffect(()=>{const h=a.current;return()=>{window.clearTimeout(h),u(null)}},[a,u]),v.jsx(Y1,{asChild:!0,...c,children:v.jsx(FI,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":JI(n.open),...e,ref:om(t,i.onTriggerChange),onClick:h=>{var p;(p=e.onClick)==null||p.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,Gc(h=>{o.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:Re(e.onPointerLeave,Gc(h=>{var m,y;f();const p=(m=n.content)==null?void 0:m.getBoundingClientRect();if(p){const x=(y=n.content)==null?void 0:y.dataset.side,k=x==="right",w=k?-5:5,E=p[k?"left":"right"],C=p[k?"right":"left"];o.onPointerGraceIntentChange({area:[{x:h.clientX+w,y:h.clientY},{x:E,y:p.top},{x:C,y:p.top},{x:C,y:p.bottom},{x:E,y:p.bottom}],side:x}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(h),h.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,h=>{var m;const p=o.searchRef.current!=="";e.disabled||p&&h.key===" "||Dee[r.dir].includes(h.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),h.preventDefault())})})})});KI.displayName=pc;var XI="MenuSubContent",QI=S.forwardRef((e,t)=>{const n=OI(Ur,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Cs(Ur,e.__scopeMenu),s=Bd(Ur,e.__scopeMenu),a=GI(XI,e.__scopeMenu),u=S.useRef(null),c=pt(t,u);return v.jsx(qc.Provider,{scope:e.__scopeMenu,children:v.jsx(nr,{present:r||o.open,children:v.jsx(qc.Slot,{scope:e.__scopeMenu,children:v.jsx(Z1,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var h;s.isUsingKeyboardRef.current&&((h=u.current)==null||h.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:Re(e.onFocusOutside,f=>{f.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,f=>{s.onClose(),f.preventDefault()}),onKeyDown:Re(e.onKeyDown,f=>{var m;const h=f.currentTarget.contains(f.target),p=Oee[s.dir].includes(f.key);h&&p&&(o.onOpenChange(!1),(m=a.trigger)==null||m.focus(),f.preventDefault())})})})})})});QI.displayName=XI;function JI(e){return e?"open":"closed"}function Np(e){return e==="indeterminate"}function J1(e){return Np(e)?"indeterminate":e?"checked":"unchecked"}function Qee(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Jee(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ete(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=Jee(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const u=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function tte(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,u=t[o].y,c=t[s].x,f=t[s].y;u>r!=f>r&&n<(c-a)*(r-u)/(f-u)+a&&(i=!i)}return i}function nte(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return tte(n,t)}function Gc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var rte=DI,ite=Y1,ote=II,ste=jI,ate=K1,lte=LI,ute=Dm,cte=zI,dte=BI,fte=WI,hte=HI,pte=YI,mte=qI,gte=ZI,yte=KI,vte=QI,ek="DropdownMenu",[xte,Eve]=Yr(ek,[PI]),qn=PI(),[wte,ej]=xte(ek),tj=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,u=qn(t),c=S.useRef(null),[f=!1,h]=wo({prop:i,defaultProp:o,onChange:s});return v.jsx(wte,{scope:t,triggerId:En(),triggerRef:c,contentId:En(),open:f,onOpenChange:h,onOpenToggle:S.useCallback(()=>h(p=>!p),[h]),modal:a,children:v.jsx(rte,{...u,open:f,onOpenChange:h,dir:r,modal:a,children:n})})};tj.displayName=ek;var nj="DropdownMenuTrigger",rj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=ej(nj,n),s=qn(n);return v.jsx(ite,{asChild:!0,...s,children:v.jsx(Ue.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:om(t,o.triggerRef),onPointerDown:Re(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Re(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});rj.displayName=nj;var bte="DropdownMenuPortal",ij=e=>{const{__scopeDropdownMenu:t,...n}=e,r=qn(t);return v.jsx(ote,{...r,...n})};ij.displayName=bte;var oj="DropdownMenuContent",sj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ej(oj,n),o=qn(n),s=S.useRef(!1);return v.jsx(ste,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:Re(e.onCloseAutoFocus,a=>{var u;s.current||(u=i.triggerRef.current)==null||u.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Re(e.onInteractOutside,a=>{const u=a.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;(!i.modal||f)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});sj.displayName=oj;var kte="DropdownMenuGroup",aj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(ate,{...i,...r,ref:t})});aj.displayName=kte;var Ste="DropdownMenuLabel",lj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(lte,{...i,...r,ref:t})});lj.displayName=Ste;var Ete="DropdownMenuItem",uj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(ute,{...i,...r,ref:t})});uj.displayName=Ete;var Cte="DropdownMenuCheckboxItem",cj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(cte,{...i,...r,ref:t})});cj.displayName=Cte;var _te="DropdownMenuRadioGroup",dj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(dte,{...i,...r,ref:t})});dj.displayName=_te;var Nte="DropdownMenuRadioItem",fj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(fte,{...i,...r,ref:t})});fj.displayName=Nte;var Tte="DropdownMenuItemIndicator",hj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(hte,{...i,...r,ref:t})});hj.displayName=Tte;var Ate="DropdownMenuSeparator",pj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(pte,{...i,...r,ref:t})});pj.displayName=Ate;var Pte="DropdownMenuArrow",Rte=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(mte,{...i,...r,ref:t})});Rte.displayName=Pte;var Mte=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:o}=e,s=qn(t),[a=!1,u]=wo({prop:r,defaultProp:o,onChange:i});return v.jsx(gte,{...s,open:a,onOpenChange:u,children:n})},Dte="DropdownMenuSubTrigger",mj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(yte,{...i,...r,ref:t})});mj.displayName=Dte;var Ote="DropdownMenuSubContent",gj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qn(n);return v.jsx(vte,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gj.displayName=Ote;var Ite=tj,yj=rj,vj=ij,xj=sj,jte=aj,wj=lj,bj=uj,kj=cj,Lte=dj,Sj=fj,Ej=hj,Cj=pj,Fte=Mte,_j=mj,Nj=gj;function rl(e,t,n){let r=n.initialDeps??[],i;return()=>{var o,s,a,u;let c;n.key&&((o=n.debug)!=null&&o.call(n))&&(c=Date.now());const f=e();if(!(f.length!==r.length||f.some((m,y)=>r[y]!==m)))return i;r=f;let p;if(n.key&&((s=n.debug)!=null&&s.call(n))&&(p=Date.now()),i=t(...f),n.key&&((a=n.debug)!=null&&a.call(n))){const m=Math.round((Date.now()-c)*100)/100,y=Math.round((Date.now()-p)*100)/100,x=y/16,k=(w,E)=>{for(w=String(w);w.length<E;)w=" "+w;return w};console.info(`%c⏱ ${k(y,5)} /${k(m,5)} ms`,`
288
+ font-size: .6rem;
289
+ font-weight: bold;
290
+ color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(u=n==null?void 0:n.onChange)==null||u.call(n,i),i}}function ex(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const zte=(e,t)=>Math.abs(e-t)<1,$te=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Bte=e=>e,Vte=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},Wte=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=s=>{const{width:a,height:u}=s;t({width:Math.round(a),height:Math.round(u)})};if(i(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(s=>{const a=s[0];if(a!=null&&a.borderBoxSize){const u=a.borderBoxSize[0];if(u){i({width:u.inlineSize,height:u.blockSize});return}}i(n.getBoundingClientRect())});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},cT={passive:!0},Ute=typeof window>"u"?!0:"onscrollend"in window,Hte=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const o=e.options.useScrollendEvent&&Ute?()=>{}:$te(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),s=c=>()=>{const{horizontal:f,isRtl:h}=e.options;i=f?n.scrollLeft*(h&&-1||1):n.scrollTop,o(),t(i,c)},a=s(!0),u=s(!1);return u(),n.addEventListener("scroll",a,cT),n.addEventListener("scrollend",u,cT),()=>{n.removeEventListener("scroll",a),n.removeEventListener("scrollend",u)}},Yte=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},qte=(e,{adjustments:t=0,behavior:n},r)=>{var i,o;const s=e+t;(o=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class Gte{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(o=>{this._measureElement(o.target,o)})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var o;return(o=r())==null?void 0:o.observe(i,{box:"border-box"})},unobserve:i=>{var o;return(o=r())==null?void 0:o.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Bte,rangeExtractor:Vte,onChange:()=>{},measureElement:Yte,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=rl(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const i=new Map,o=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(i.has(a.lane))continue;const u=o.get(a.lane);if(u==null||a.end>u.end?o.set(a.lane,a):a.end<u.end&&i.set(a.lane,!0),i.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=rl(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,i,o,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:o,enabled:s}),{key:!1}),this.getMeasurements=rl(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:o,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const u=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,u);for(let f=u;f<n;f++){const h=o(f),p=this.options.lanes===1?c[f-1]:this.getFurthestMeasurement(c,f),m=p?p.end+this.options.gap:r+i,y=a.get(h),x=typeof y=="number"?y:this.options.estimateSize(f),k=m+x,w=p?p.lane:f%this.options.lanes;c[f]={index:f,start:m,size:x,end:k,key:h,lane:w}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=rl(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,r,i)=>this.range=n.length>0&&r>0?Zte({measurements:n,outerSize:r,scrollOffset:i}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=rl(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,r,i,o)=>r===null?[]:n({startIndex:r.startIndex,endIndex:r.endIndex,overscan:i,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const i=this.indexFromElement(n),o=this.measurementsCache[i];if(!o)return;const s=o.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(i,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const i=this.measurementsCache[n];if(!i)return;const o=this.itemSizeCache.get(i.key)??i.size,s=r-o;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,s,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,i)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(i))});return}this._measureElement(n,void 0)},this.getVirtualItems=rl(()=>[this.getIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let o=0,s=n.length;o<s;o++){const a=n[o],u=r[a];i.push(u)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return ex(r[Tj(0,r.length-1,i=>ex(r[i]).start,n)])},this.getOffsetForAlignment=(n,r)=>{const i=this.getSize(),o=this.getScrollOffset();r==="auto"&&n>=o+i&&(r="end"),r==="end"&&(n-=i);const s=this.options.horizontal?"scrollWidth":"scrollHeight",u=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-i;return Math.max(Math.min(u,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.measurementsCache[n];if(!i)return;const o=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(i.end>=s+o-this.options.scrollPaddingEnd)r="end";else if(i.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=i.start-this.options.scrollPaddingStart+(i.size-o)/2;switch(r){case"center":return[this.getOffsetForAlignment(a,r),r];case"end":return[this.getOffsetForAlignment(i.end+this.options.scrollPaddingEnd,r),r];default:return[this.getOffsetForAlignment(i.start-this.options.scrollPaddingStart,r),r]}},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:i})},this.scrollToIndex=(n,{align:r="auto",behavior:i}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const o=this.getOffsetForIndex(n,r);if(!o)return;const[s,a]=o;this._scrollToOffset(s,{adjustments:void 0,behavior:i}),i!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=ex(this.getOffsetForIndex(n,a));zte(c,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:i})}else this.scrollToIndex(n,{align:a,behavior:i})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;return r.length===0?i=this.options.paddingStart:i=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(o=>o.end)),Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const Tj=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,o=n(i);if(o<r)e=i+1;else if(o>r)t=i-1;else return i}return e>0?e-1:0};function Zte({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,o=Tj(0,r,a=>e[a].start,n);let s=o;for(;s<r&&e[s].end<n+t;)s++;return{startIndex:o,endIndex:s}}const dT=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Kte(e){const t=S.useReducer(()=>({}),{})[1],n={...e,onChange:(i,o)=>{var s;o?eu.flushSync(t):t(),(s=e.onChange)==null||s.call(e,i,o)}},[r]=S.useState(()=>new Gte(n));return r.setOptions(n),dT(()=>r._didMount(),[]),dT(()=>r._willUpdate()),r}function Xte(e){return Kte({observeElementRect:Wte,observeElementOffset:Hte,scrollToFn:qte,...e})}const Qte=Ite,Jte=jte,ene=vj,tne=Fte,nne=Lte,Aj=S.forwardRef(({className:e,inset:t,children:n,...r},i)=>v.jsx(yj,{ref:i,className:Te("focus-visible:ring-ring focus:outline-none focus-visible:rounded focus-visible:outline-none focus-visible:ring-1",e),...r,children:n}));Aj.displayName=yj.displayName;const Pj=S.forwardRef(({className:e,inset:t,children:n,...r},i)=>v.jsxs(_j,{ref:i,className:Te("focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none",t&&"pl-8",e),...r,children:[n,v.jsx(hb,{className:"ml-auto -rotate-90"})]}));Pj.displayName=_j.displayName;const Rj=S.forwardRef(({className:e,...t},n)=>v.jsx(Nj,{ref:n,className:Te("popover-backdrop-filter popover-background popover-border popover-shadow popover-foreground data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-[8rem] overflow-auto overflow-x-hidden rounded-md p-1",e),...t}));Rj.displayName=Nj.displayName;const Mj=S.forwardRef(({className:e,container:t,sideOffset:n=4,...r},i)=>v.jsx(vj,{container:t,children:v.jsx(xj,{ref:i,sideOffset:n,className:Te("popover-backdrop-filter bg-mastra-bg-2 popover-border popover-shadow popover-foreground data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-[8rem] overflow-auto overflow-x-hidden rounded-md p-1",e),...r})}));Mj.displayName=xj.displayName;const Dj=S.forwardRef(({className:e,inset:t,...n},r)=>v.jsx(bj,{ref:r,className:Te("focus:text-accent-foreground relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-[0.8125rem] outline-none transition-colors focus:bg-[#66686A]/20 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>span]:truncate",t&&"pl-8",e),...n}));Dj.displayName=bj.displayName;const Oj=S.forwardRef(({className:e,children:t,checked:n,...r},i)=>v.jsxs(kj,{ref:i,className:Te("focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(Ej,{children:v.jsx(fb,{className:"h-2 w-2 fill-current"})})}),t]}));Oj.displayName=kj.displayName;const Ij=S.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(Sj,{ref:r,className:Te("focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(Ej,{children:v.jsx(VB,{className:"h-2 w-2 fill-current"})})}),t]}));Ij.displayName=Sj.displayName;const jj=S.forwardRef(({className:e,inset:t,...n},r)=>v.jsx(wj,{ref:r,className:Te("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));jj.displayName=wj.displayName;const Lj=S.forwardRef(({className:e,...t},n)=>v.jsx(Cj,{ref:n,className:Te("popover-dividers-bg -mx-1 my-1 h-px",e),...t}));Lj.displayName=Cj.displayName;const Fj=({className:e,...t})=>v.jsx("span",{className:Te("ml-auto text-xs tracking-widest opacity-60",e),...t});Fj.displayName="DropdownMenuShortcut";function Sn({open:e,onOpenChange:t,children:n,modal:r}){return v.jsx(Qte,{modal:r,open:e,onOpenChange:t,children:n})}function rne({itemsCount:e,items:t,renderItem:n,...r}){const i=S.useRef(null),o=Xte({count:e,estimateSize:()=>35,getScrollElement:()=>i.current,overscan:5,measureElement:typeof window<"u"&&navigator.userAgent.indexOf("Firefox")===-1?s=>s==null?void 0:s.getBoundingClientRect().height:void 0});return v.jsx("div",{ref:i,className:"h-64 overflow-auto",children:v.jsx("div",{className:"relative w-full overflow-auto",style:{height:`${o.getTotalSize()}px`},children:o==null?void 0:o.getVirtualItems().map((s,a)=>v.jsx("button",{className:"text-accent-foreground absolute left-0 top-0 flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-[0.8125rem] outline-none transition-colors hover:bg-[#66686A]/20 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>span]:truncate",style:{height:`${s.size}px`,transform:`translateY(${s.start}px)`},...r,children:n(t[a])},s.index))})})}Sn.Trigger=Aj;Sn.Content=Mj;Sn.Group=Jte;Sn.Portal=ene;Sn.Item=Dj;Sn.CheckboxItem=Oj;Sn.RadioItem=Ij;Sn.Label=jj;Sn.Separator=Lj;Sn.Shortcut=Fj;Sn.Sub=tne;Sn.SubContent=Rj;Sn.SubTrigger=Pj;Sn.RadioGroup=nne;Sn.VirtualizedItems=rne;const ine=()=>{const{data:e,isLoading:t,mutate:n}=_b("/api/memory/status",mb,{fallbackData:{result:!1}});return{memory:e,isLoading:t,mutate:n}},one=({resourceid:e})=>{const{data:t,isLoading:n,mutate:r}=_b(`/api/memory/threads?resourceid=${e}`,mb,{fallbackData:[],isPaused:()=>!e,revalidateOnFocus:!1});return S.useEffect(()=>{e&&r()},[e]),{threads:t,isLoading:n,mutate:r}},sne=({threadId:e,memory:t})=>{const{data:n,isLoading:r,mutate:i}=_b(`/api/memory/threads/${e}/messages`,o=>mb(o,!0),{fallbackData:{uiMessages:[],messages:[]},revalidateOnFocus:!1,shouldRetryOnError:!1});return S.useEffect(()=>{e&&t&&i()},[e,t]),{messages:n==null?void 0:n.uiMessages,isLoading:r,mutate:i}},ane=()=>{const{mutate:e}=Cb();return{deleteThread:async({threadId:n,resourceid:r})=>{const i=fetch(`/api/memory/threads/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json"}});mn.promise(i,{loading:"Deleting chat...",success:()=>(e(`/api/memory/threads?resourceid=${r}`),"Chat deleted successfully"),error:"Failed to delete chat"})}}};function lne({agentId:e,threadId:t}){const{threads:n,isLoading:r}=one({resourceid:e}),{deleteThread:i}=ane(),o=ks(),[s,a]=S.useState(null),[u,c]=S.useState(!1),f=async()=>{await i({threadId:s,resourceid:e}),c(!1),s===t&&o(`/agents/${e}`)};return r?v.jsxs("div",{className:"p-4 w-full h-full space-y-2",children:[v.jsx("div",{className:"flex justify-end",children:v.jsx(Je,{className:"h-9 w-9"})}),v.jsx(Je,{className:"h-4"}),v.jsx(Je,{className:"h-4"}),v.jsx(Je,{className:"h-4"}),v.jsx(Je,{className:"h-4"}),v.jsx(Je,{className:"h-4"})]}):n!=null&&n.length?v.jsxs(fr,{className:"h-full p-4 w-[256px]",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex justify-between items-center pl-2",children:[v.jsx("div",{className:"text-sm text-mastra-el-5",children:"Chat history"}),v.jsx(Bt,{variant:"primary",size:"icon",onClick:()=>o(`/agents/${e}`),children:v.jsx(jc,{})})]}),n.map(h=>{const p=h.id===t;return v.jsxs("div",{className:Te("flex cursor-pointer w-full px-2 items-center focus-visible:outline-none transition-colors focus-visible:ring-1 focus-visible:ring-mastra-border-4 gap-3 rounded-xs group text-small hover:bg-mastra-el-6/5",p?"bg-mastra-el-6/5":""),children:[v.jsx(Ed,{to:`/agents/${e}/${h.id}`,className:"flex-1",children:v.jsx("p",{className:Te("py-[0.38rem] text-mastra-el-6/60 group-hover:text-mastra-el-6 transition-all capitalize ",p?"text-mastra-el-6":""),children:h.title})}),v.jsxs(Sn,{children:[v.jsx(Sn.Trigger,{asChild:!0,children:v.jsxs(Bt,{variant:"ghost",size:"icon",className:"ml-auto",children:[v.jsx(HB,{}),v.jsx("span",{className:"sr-only",children:"More"})]})}),v.jsx(Sn.Content,{children:v.jsxs(Sn.Item,{className:"cursor-pointer text-destructive focus:bg-destructive/15 focus:text-destructive dark:text-red-500",onSelect:()=>{a(h.id),c(!0)},children:[v.jsx(QB,{}),v.jsx("span",{children:"Delete"})]})})]})]},h.id)})]}),v.jsx(An,{open:u,onOpenChange:c,children:v.jsxs(An.Content,{children:[v.jsxs(An.Header,{children:[v.jsx(An.Title,{children:"Are you absolutely sure?"}),v.jsx(An.Description,{children:"This action cannot be undone. This will permanently delete your chat and remove it from our servers."})]}),v.jsxs(An.Footer,{children:[v.jsx(An.Cancel,{children:"Cancel"}),v.jsx(An.Action,{onClick:f,children:"Continue"})]})]})})]}):v.jsxs("div",{className:"p-4 w-full space-y-2 h-full",children:[v.jsxs("div",{className:"flex justify-between items-center",children:[v.jsx("div",{className:"text-sm text-mastra-el-5",children:"Chat history"}),v.jsx(Bt,{variant:"primary",size:"icon",onClick:()=>o(`/agents/${e}`),children:v.jsx(jc,{})})]}),v.jsx("div",{className:"text-small text-mastra-el-3",children:"Your conversations will appear here once you start chatting!"})]})}function fT(){const{agentId:e,threadId:t}=tm(),{agent:n,isLoading:r}=im(e),{memory:i}=ine(),o=ks(),{messages:s,isLoading:a}=sne({threadId:t,memory:!!(i!=null&&i.result)}),[u,c]=S.useState(!0);if(S.useEffect(()=>{i!=null&&i.result&&!t&&o(`/agents/${e}/${crypto.randomUUID()}`)},[i==null?void 0:i.result,t]),r)return v.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v.jsx(Er,{title:v.jsx(Je,{className:"h-6 w-[200px]"})}),v.jsxs("main",{className:"flex-1 relative grid grid-cols-[256px_1fr_400px] divide-x",children:[v.jsx("div",{className:"p-4",children:v.jsx(Je,{className:"h-[600px]"})}),v.jsx("div",{className:"p-4",children:v.jsx(Je,{className:"h-[600px]"})}),v.jsx("div",{className:"flex flex-col",children:v.jsx(VN,{agentId:e})})]})]});const f=[{label:"Agents",href:"/agents"},{label:n==null?void 0:n.name,href:`/agents/${e}`,isCurrent:!0}];return v.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v.jsx(Er,{title:v.jsx(km,{items:f})}),v.jsxs("main",{className:Te("flex-1 relative grid divide-x",u&&(i!=null&&i.result)?"grid-cols-[256px_1fr_400px]":"grid-cols-[1fr_400px]"),children:[u&&(i!=null&&i.result)?v.jsx(lne,{agentId:e,threadId:t}):null,v.jsxs("div",{className:"relative",children:[i!=null&&i.result?v.jsx(Bt,{variant:"primary",size:"icon",className:"absolute top-4 left-4 z-50",onClick:()=>c(!u),children:v.jsx(ZB,{})}):null,v.jsx(OX,{agentId:e,agentName:n==null?void 0:n.name,threadId:t,initialMessages:a?void 0:s,memory:i==null?void 0:i.result})]}),v.jsx("div",{className:"flex flex-col",children:v.jsx(VN,{agentId:e})})]})]})}const zj=(e,t)=>e.anyOf.length?e.anyOf.length===1?Pn(e.anyOf[0],{...t,path:[...t.path,"anyOf",0]}):`z.union([${e.anyOf.map((n,r)=>Pn(n,{...t,path:[...t.path,"anyOf",r]})).join(", ")}])`:"z.any()",une=e=>"z.boolean()",cne=e=>"z.any()",dne=(e,t)=>`z.union([${e.type.map(n=>Pn({...e,type:n},t)).join(", ")}])`,fne=(e,t)=>`z.any().refine((value) => !${Pn(e.not,{...t,path:[...t.path,"not"]})}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,hne=e=>"z.null()",pne=e=>[e.slice(0,e.length/2),e.slice(e.length/2)],mc=Symbol("Original index"),mne=e=>{let t=[];for(let n=0;n<e.length;n++){const r=e[n];if(typeof r=="boolean")t.push(r?{[mc]:n}:{[mc]:n,not:{}});else{if(mc in r)return e;t.push({...r,[mc]:n})}}return t};function Tp(e,t){if(e.allOf.length===0)return"z.never()";if(e.allOf.length===1){const n=e.allOf[0];return Pn(n,{...t,path:[...t.path,"allOf",n[mc]]})}else{const[n,r]=pne(mne(e.allOf));return`z.intersection(${Tp({allOf:n},t)}, ${Tp({allOf:r},t)})`}}function Tn(e,t,n){var o;const r=e[t];let i="";if(r!==void 0){const s=n({value:r,json:JSON.stringify(r)});if(s){const a=s[0],u=s.length===3?s[1]:"",c=s.length===3?s[2]:s[1];i+=a,((o=e.errorMessage)==null?void 0:o[t])!==void 0&&(i+=u+JSON.stringify(e.errorMessage[t])),i+=c}}return i}const gne=(e,t)=>{if(Array.isArray(e.items))return`z.tuple([${e.items.map((r,i)=>Pn(r,{...t,path:[...t.path,"items",i]}))}])`;let n=e.items?`z.array(${Pn(e.items,{...t,path:[...t.path,"items"]})})`:"z.array(z.any())";return n+=Tn(e,"minItems",({json:r})=>[`.min(${r}`,", ",")"]),n+=Tn(e,"maxItems",({json:r})=>[`.max(${r}`,", ",")"]),n},yne=e=>`z.literal(${JSON.stringify(e.const)})`,vne=e=>e.enum.length===0?"z.never()":e.enum.length===1?`z.literal(${JSON.stringify(e.enum[0])})`:e.enum.every(t=>typeof t=="string")?`z.enum([${e.enum.map(t=>JSON.stringify(t))}])`:`z.union([${e.enum.map(t=>`z.literal(${JSON.stringify(t)})`).join(", ")}])`,xne=(e,t)=>{const n=Pn(e.if,{...t,path:[...t.path,"if"]}),r=Pn(e.then,{...t,path:[...t.path,"then"]}),i=Pn(e.else,{...t,path:[...t.path,"else"]});return`z.union([${r}, ${i}]).superRefine((value,ctx) => {
291
+ const result = ${n}.safeParse(value).success
292
+ ? ${r}.safeParse(value)
293
+ : ${i}.safeParse(value);
294
+ if (!result.success) {
295
+ result.error.errors.forEach((error) => ctx.addIssue(error))
296
+ }
297
+ })`},wne=e=>{let t="z.number()";return e.type==="integer"?t+=Tn(e,"type",()=>[".int(",")"]):t+=Tn(e,"format",({value:n})=>{if(n==="int64")return[".int(",")"]}),t+=Tn(e,"multipleOf",({value:n,json:r})=>n===1?t.startsWith("z.number().int(")?void 0:[".int(",")"]:[`.multipleOf(${r}`,", ",")"]),typeof e.minimum=="number"?e.exclusiveMinimum===!0?t+=Tn(e,"minimum",({json:n})=>[`.gt(${n}`,", ",")"]):t+=Tn(e,"minimum",({json:n})=>[`.gte(${n}`,", ",")"]):typeof e.exclusiveMinimum=="number"&&(t+=Tn(e,"exclusiveMinimum",({json:n})=>[`.gt(${n}`,", ",")"])),typeof e.maximum=="number"?e.exclusiveMaximum===!0?t+=Tn(e,"maximum",({json:n})=>[`.lt(${n}`,", ",")"]):t+=Tn(e,"maximum",({json:n})=>[`.lte(${n}`,", ",")"]):typeof e.exclusiveMaximum=="number"&&(t+=Tn(e,"exclusiveMaximum",({json:n})=>[`.lt(${n}`,", ",")"])),t},$j=(e,t)=>e.oneOf.length?e.oneOf.length===1?Pn(e.oneOf[0],{...t,path:[...t.path,"oneOf",0]}):`z.any().superRefine((x, ctx) => {
298
+ const schemas = [${e.oneOf.map((n,r)=>Pn(n,{...t,path:[...t.path,"oneOf",r]})).join(", ")}];
299
+ const errors = schemas.reduce<z.ZodError[]>(
300
+ (errors, schema) =>
301
+ ((result) =>
302
+ result.error ? [...errors, result.error] : errors)(
303
+ schema.safeParse(x),
304
+ ),
305
+ [],
306
+ );
307
+ if (schemas.length - errors.length !== 1) {
308
+ ctx.addIssue({
309
+ path: ctx.path,
310
+ code: "invalid_union",
311
+ unionErrors: errors,
312
+ message: "Invalid input: Should pass single schema",
313
+ });
314
+ }
315
+ })`:"z.any()";function bne(e,t){let n;e.properties&&(Object.keys(e.properties).length?(n="z.object({ ",n+=Object.keys(e.properties).map(s=>{const a=e.properties[s],u=`${JSON.stringify(s)}: ${Pn(a,{...t,path:[...t.path,"properties",s]})}`,c=typeof a=="object"&&a.default!==void 0,f=Array.isArray(e.required)?e.required.includes(s):typeof a=="object"&&a.required===!0;return!c&&!f?`${u}.optional()`:u}).join(", "),n+=" })"):n="z.object({})");const r=e.additionalProperties!==void 0?Pn(e.additionalProperties,{...t,path:[...t.path,"additionalProperties"]}):void 0;let i;if(e.patternProperties){const s=Object.fromEntries(Object.entries(e.patternProperties).map(([a,u])=>[a,Pn(u,{...t,path:[...t.path,"patternProperties",a]})],{}));i="",n?r?i+=`.catchall(z.union([${[...Object.values(s),r].join(", ")}]))`:Object.keys(s).length>1?i+=`.catchall(z.union([${Object.values(s).join(", ")}]))`:i+=`.catchall(${Object.values(s)})`:r?i+=`z.record(z.union([${[...Object.values(s),r].join(", ")}]))`:Object.keys(s).length>1?i+=`z.record(z.union([${Object.values(s).join(", ")}]))`:i+=`z.record(${Object.values(s)})`,i+=`.superRefine((value, ctx) => {
316
+ `,i+=`for (const key in value) {
317
+ `,r&&(e.properties?i+=`let evaluated = [${Object.keys(e.properties).map(a=>JSON.stringify(a)).join(", ")}].includes(key)
318
+ `:i+=`let evaluated = false
319
+ `);for(const a in e.patternProperties)i+="if (key.match(new RegExp("+JSON.stringify(a)+`))) {
320
+ `,r&&(i+=`evaluated = true
321
+ `),i+="const result = "+s[a]+`.safeParse(value[key])
322
+ `,i+=`if (!result.success) {
323
+ `,i+=`ctx.addIssue({
324
+ path: [...ctx.path, key],
325
+ code: 'custom',
326
+ message: \`Invalid input: Key matching regex /\${key}/ must match schema\`,
327
+ params: {
328
+ issues: result.error.issues
329
+ }
330
+ })
331
+ `,i+=`}
332
+ `,i+=`}
333
+ `;r&&(i+=`if (!evaluated) {
334
+ `,i+="const result = "+r+`.safeParse(value[key])
335
+ `,i+=`if (!result.success) {
336
+ `,i+=`ctx.addIssue({
337
+ path: [...ctx.path, key],
338
+ code: 'custom',
339
+ message: \`Invalid input: must match catchall schema\`,
340
+ params: {
341
+ issues: result.error.issues
342
+ }
343
+ })
344
+ `,i+=`}
345
+ `,i+=`}
346
+ `),i+=`}
347
+ `,i+="})"}let o=n?i?n+i:r?r==="z.never()"?n+".strict()":n+`.catchall(${r})`:n:i||(r?`z.record(${r})`:"z.record(z.any())");return bn.an.anyOf(e)&&(o+=`.and(${zj({...e,anyOf:e.anyOf.map(s=>typeof s=="object"&&!s.type&&(s.properties||s.additionalProperties||s.patternProperties)?{...s,type:"object"}:s)},t)})`),bn.a.oneOf(e)&&(o+=`.and(${$j({...e,oneOf:e.oneOf.map(s=>typeof s=="object"&&!s.type&&(s.properties||s.additionalProperties||s.patternProperties)?{...s,type:"object"}:s)},t)})`),bn.an.allOf(e)&&(o+=`.and(${Tp({...e,allOf:e.allOf.map(s=>typeof s=="object"&&!s.type&&(s.properties||s.additionalProperties||s.patternProperties)?{...s,type:"object"}:s)},t)})`),o}const kne=e=>{let t="z.string()";t+=Tn(e,"format",({value:r})=>{switch(r){case"email":return[".email(",")"];case"ip":return[".ip(",")"];case"ipv4":return['.ip({ version: "v4"',", message: "," })"];case"ipv6":return['.ip({ version: "v6"',", message: "," })"];case"uri":return[".url(",")"];case"uuid":return[".uuid(",")"];case"date-time":return[".datetime({ offset: true",", message: "," })"];case"time":return[".time(",")"];case"date":return[".date(",")"];case"binary":return[".base64(",")"];case"duration":return[".duration(",")"]}}),t+=Tn(e,"pattern",({json:r})=>[`.regex(new RegExp(${r})`,", ",")"]),t+=Tn(e,"minLength",({json:r})=>[`.min(${r}`,", ",")"]),t+=Tn(e,"maxLength",({json:r})=>[`.max(${r}`,", ",")"]),t+=Tn(e,"contentEncoding",({value:r})=>{if(r==="base64")return[".base64(",")"]});const n=Tn(e,"contentMediaType",({value:r})=>{if(r==="application/json")return['.transform((str, ctx) => { try { return JSON.parse(str); } catch (err) { ctx.addIssue({ code: "custom", message: "Invalid JSON" }); }}',", ",")"]});return n!=""&&(t+=n,t+=Tn(e,"contentSchema",({value:r})=>{if(r&&r instanceof Object)return[`.pipe(${Pn(r)}`,", ",")"]})),t},Sne=(e,...t)=>Object.keys(e).reduce((n,r)=>(t.includes(r)||(n[r]=e[r]),n),{}),Ene=(e,t)=>`${Pn(Sne(e,"nullable"),t,!0)}.nullable()`,Pn=(e,t={seen:new Map,path:[]},n)=>{if(typeof e!="object")return e?"z.any()":"z.never()";if(t.parserOverride){const o=t.parserOverride(e,t);if(typeof o=="string")return o}let r=t.seen.get(e);if(r){if(r.r!==void 0)return r.r;if(t.depth===void 0||r.n>=t.depth)return"z.any()";r.n+=1}else r={r:void 0,n:0},t.seen.set(e,r);let i=Tne(e,t);return n||(t.withoutDescribes||(i=Cne(e,i)),t.withoutDefaults||(i=_ne(e,i)),i=Nne(e,i)),r.r=i,i},Cne=(e,t)=>(e.description&&(t+=`.describe(${JSON.stringify(e.description)})`),t),_ne=(e,t)=>(e.default!==void 0&&(t+=`.default(${JSON.stringify(e.default)})`),t),Nne=(e,t)=>(e.readOnly&&(t+=".readonly()"),t),Tne=(e,t)=>bn.a.nullable(e)?Ene(e,t):bn.an.object(e)?bne(e,t):bn.an.array(e)?gne(e,t):bn.an.anyOf(e)?zj(e,t):bn.an.allOf(e)?Tp(e,t):bn.a.oneOf(e)?$j(e,t):bn.a.not(e)?fne(e,t):bn.an.enum(e)?vne(e):bn.a.const(e)?yne(e):bn.a.multipleType(e)?dne(e,t):bn.a.primitive(e,"string")?kne(e):bn.a.primitive(e,"number")||bn.a.primitive(e,"integer")?wne(e):bn.a.primitive(e,"boolean")?une():bn.a.primitive(e,"null")?hne():bn.a.conditional(e)?xne(e,t):cne(),bn={an:{object:e=>e.type==="object",array:e=>e.type==="array",anyOf:e=>e.anyOf!==void 0,allOf:e=>e.allOf!==void 0,enum:e=>e.enum!==void 0},a:{nullable:e=>e.nullable===!0,multipleType:e=>Array.isArray(e.type),not:e=>e.not!==void 0,const:e=>e.const!==void 0,primitive:(e,t)=>e.type===t,conditional:e=>!!("if"in e&&e.if&&"then"in e&&"else"in e&&e.then&&e.else),oneOf:e=>e.oneOf!==void 0}},tk=(e,{module:t,name:n,type:r,noImport:i,...o}={})=>{if(r&&(!n||t!=="esm"))throw new Error("Option `type` requires `name` to be set and `module` to be `esm`");let s=Pn(e,{module:t,name:n,path:[],seen:new Map,...o});if(t==="cjs"?(s=`module.exports = ${n?`{ ${JSON.stringify(n)}: ${s} }`:s}
348
+ `,i||(s=`const { z } = require("zod")
349
+
350
+ ${s}`)):t==="esm"?(s=`export ${n?`const ${n} =`:"default"} ${s}
351
+ `,i||(s=`import { z } from "zod"
352
+
353
+ ${s}`)):n&&(s=`const ${n} = ${s}`),r&&n){let a=typeof r=="string"?r:`${n[0].toUpperCase()}${n.substring(1)}`;s+=`export type ${a} = z.infer<typeof ${n}>
354
+ `}return s};class Ane{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(t,n){this.keyToValue.set(t,n),this.valueToKey.set(n,t)}getByKey(t){return this.keyToValue.get(t)}getByValue(t){return this.valueToKey.get(t)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class Bj{constructor(t){this.generateIdentifier=t,this.kv=new Ane}register(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}}class Pne extends Bj{constructor(){super(t=>t.name),this.classToAllowedProps=new Map}register(t,n){typeof n=="object"?(n.allowProps&&this.classToAllowedProps.set(t,n.allowProps),super.register(t,n.identifier)):super.register(t,n)}getAllowedProps(t){return this.classToAllowedProps.get(t)}}function Rne(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function Mne(e,t){const n=Rne(e);if("find"in n)return n.find(t);const r=n;for(let i=0;i<r.length;i++){const o=r[i];if(t(o))return o}}function Ol(e,t){Object.entries(e).forEach(([n,r])=>t(r,n))}function Qh(e,t){return e.indexOf(t)!==-1}function hT(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(t(r))return r}}class Dne{constructor(){this.transfomers={}}register(t){this.transfomers[t.name]=t}findApplicable(t){return Mne(this.transfomers,n=>n.isApplicable(t))}findByName(t){return this.transfomers[t]}}const One=e=>Object.prototype.toString.call(e).slice(8,-1),Vj=e=>typeof e>"u",Ine=e=>e===null,Zc=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,kw=e=>Zc(e)&&Object.keys(e).length===0,ys=e=>Array.isArray(e),jne=e=>typeof e=="string",Lne=e=>typeof e=="number"&&!isNaN(e),Fne=e=>typeof e=="boolean",zne=e=>e instanceof RegExp,Kc=e=>e instanceof Map,Xc=e=>e instanceof Set,Wj=e=>One(e)==="Symbol",$ne=e=>e instanceof Date&&!isNaN(e.valueOf()),Bne=e=>e instanceof Error,pT=e=>typeof e=="number"&&isNaN(e),Vne=e=>Fne(e)||Ine(e)||Vj(e)||Lne(e)||jne(e)||Wj(e),Wne=e=>typeof e=="bigint",Une=e=>e===1/0||e===-1/0,Hne=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),Yne=e=>e instanceof URL,Uj=e=>e.replace(/\./g,"\\."),tx=e=>e.map(String).map(Uj).join("."),Tc=e=>{const t=[];let n="";for(let i=0;i<e.length;i++){let o=e.charAt(i);if(o==="\\"&&e.charAt(i+1)==="."){n+=".",i++;continue}if(o==="."){t.push(n),n="";continue}n+=o}const r=n;return t.push(r),t};function Si(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}const Hj=[Si(Vj,"undefined",()=>null,()=>{}),Si(Wne,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),Si($ne,"Date",e=>e.toISOString(),e=>new Date(e)),Si(Bne,"Error",(e,t)=>{const n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n},(e,t)=>{const n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(r=>{n[r]=e[r]}),n}),Si(zne,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),Si(Xc,"set",e=>[...e.values()],e=>new Set(e)),Si(Kc,"map",e=>[...e.entries()],e=>new Map(e)),Si(e=>pT(e)||Une(e),"number",e=>pT(e)?"NaN":e>0?"Infinity":"-Infinity",Number),Si(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),Si(Yne,"URL",e=>e.toString(),e=>new URL(e))];function Om(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}const Yj=Om((e,t)=>Wj(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),qne=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),qj=Om(Hne,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=qne[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function Gj(e,t){return e!=null&&e.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}const Zj=Om(Gj,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const r={};return n.forEach(i=>{r[i]=e[i]}),r},(e,t,n)=>{const r=n.classRegistry.getValue(t[1]);if(!r)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),Kj=Om((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>["custom",t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{const r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),Gne=[Zj,Yj,Kj,qj],mT=(e,t)=>{const n=hT(Gne,i=>i.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const r=hT(Hj,i=>i.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},Xj={};Hj.forEach(e=>{Xj[e.annotation]=e});const Zne=(e,t,n)=>{if(ys(t))switch(t[0]){case"symbol":return Yj.untransform(e,t,n);case"class":return Zj.untransform(e,t,n);case"custom":return Kj.untransform(e,t,n);case"typed-array":return qj.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const r=Xj[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},pl=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function Qj(e){if(Qh(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Qh(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Qh(e,"constructor"))throw new Error("constructor is not allowed as a property")}const Kne=(e,t)=>{Qj(t);for(let n=0;n<t.length;n++){const r=t[n];if(Xc(e))e=pl(e,+r);else if(Kc(e)){const i=+r,o=+t[++n]==0?"key":"value",s=pl(e,i);switch(o){case"key":e=s;break;case"value":e=e.get(s);break}}else e=e[r]}return e},Sw=(e,t,n)=>{if(Qj(t),t.length===0)return n(e);let r=e;for(let o=0;o<t.length-1;o++){const s=t[o];if(ys(r)){const a=+s;r=r[a]}else if(Zc(r))r=r[s];else if(Xc(r)){const a=+s;r=pl(r,a)}else if(Kc(r)){if(o===t.length-2)break;const u=+s,c=+t[++o]==0?"key":"value",f=pl(r,u);switch(c){case"key":r=f;break;case"value":r=r.get(f);break}}}const i=t[t.length-1];if(ys(r)?r[+i]=n(r[+i]):Zc(r)&&(r[i]=n(r[i])),Xc(r)){const o=pl(r,+i),s=n(o);o!==s&&(r.delete(o),r.add(s))}if(Kc(r)){const o=+t[t.length-2],s=pl(r,o);switch(+i==0?"key":"value"){case"key":{const u=n(s);r.set(u,r.get(s)),u!==s&&r.delete(s);break}case"value":{r.set(s,n(r.get(s)));break}}}return e};function Ew(e,t,n=[]){if(!e)return;if(!ys(e)){Ol(e,(o,s)=>Ew(o,t,[...n,...Tc(s)]));return}const[r,i]=e;i&&Ol(i,(o,s)=>{Ew(o,t,[...n,...Tc(s)])}),t(r,n)}function Xne(e,t,n){return Ew(t,(r,i)=>{e=Sw(e,i,o=>Zne(o,r,n))}),e}function Qne(e,t){function n(r,i){const o=Kne(e,Tc(i));r.map(Tc).forEach(s=>{e=Sw(e,s,()=>o)})}if(ys(t)){const[r,i]=t;r.forEach(o=>{e=Sw(e,Tc(o),()=>e)}),i&&Ol(i,n)}else Ol(t,n);return e}const Jne=(e,t)=>Zc(e)||ys(e)||Kc(e)||Xc(e)||Gj(e,t);function ere(e,t,n){const r=n.get(e);r?r.push(t):n.set(e,[t])}function tre(e,t){const n={};let r;return e.forEach(i=>{if(i.length<=1)return;t||(i=i.map(a=>a.map(String)).sort((a,u)=>a.length-u.length));const[o,...s]=i;o.length===0?r=s.map(tx):n[tx(o)]=s.map(tx)}),r?kw(n)?[r]:[r,n]:kw(n)?void 0:n}const Jj=(e,t,n,r,i=[],o=[],s=new Map)=>{const a=Vne(e);if(!a){ere(e,i,t);const m=s.get(e);if(m)return r?{transformedValue:null}:m}if(!Jne(e,n)){const m=mT(e,n),y=m?{transformedValue:m.value,annotations:[m.type]}:{transformedValue:e};return a||s.set(e,y),y}if(Qh(o,e))return{transformedValue:null};const u=mT(e,n),c=(u==null?void 0:u.value)??e,f=ys(c)?[]:{},h={};Ol(c,(m,y)=>{if(y==="__proto__"||y==="constructor"||y==="prototype")throw new Error(`Detected property ${y}. This is a prototype pollution risk, please remove it from your object.`);const x=Jj(m,t,n,r,[...i,y],[...o,e],s);f[y]=x.transformedValue,ys(x.annotations)?h[y]=x.annotations:Zc(x.annotations)&&Ol(x.annotations,(k,w)=>{h[Uj(y)+"."+w]=k})});const p=kw(h)?{transformedValue:f,annotations:u?[u.type]:void 0}:{transformedValue:f,annotations:u?[u.type,h]:h};return a||s.set(e,p),p};function eL(e){return Object.prototype.toString.call(e).slice(8,-1)}function gT(e){return eL(e)==="Array"}function nre(e){if(eL(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function rre(e,t,n,r,i){const o={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";o==="enumerable"&&(e[t]=n),i&&o==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function Cw(e,t={}){if(gT(e))return e.map(i=>Cw(i,t));if(!nre(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((i,o)=>{if(gT(t.props)&&!t.props.includes(o))return i;const s=e[o],a=Cw(s,t);return rre(i,o,a,e,t.nonenumerable),i},{})}class Rt{constructor({dedupe:t=!1}={}){this.classRegistry=new Pne,this.symbolRegistry=new Bj(n=>n.description??""),this.customTransformerRegistry=new Dne,this.allowedErrorProps=[],this.dedupe=t}serialize(t){const n=new Map,r=Jj(t,n,this,this.dedupe),i={json:r.transformedValue};r.annotations&&(i.meta={...i.meta,values:r.annotations});const o=tre(n,this.dedupe);return o&&(i.meta={...i.meta,referentialEqualities:o}),i}deserialize(t){const{json:n,meta:r}=t;let i=Cw(n);return r!=null&&r.values&&(i=Xne(i,r.values,this)),r!=null&&r.referentialEqualities&&(i=Qne(i,r.referentialEqualities)),i}stringify(t){return JSON.stringify(this.serialize(t))}parse(t){return this.deserialize(JSON.parse(t))}registerClass(t,n){this.classRegistry.register(t,n)}registerSymbol(t,n){this.symbolRegistry.register(t,n)}registerCustom(t,n){this.customTransformerRegistry.register({name:n,...t})}allowErrorProps(...t){this.allowedErrorProps.push(...t)}}Rt.defaultInstance=new Rt;Rt.serialize=Rt.defaultInstance.serialize.bind(Rt.defaultInstance);Rt.deserialize=Rt.defaultInstance.deserialize.bind(Rt.defaultInstance);Rt.stringify=Rt.defaultInstance.stringify.bind(Rt.defaultInstance);Rt.parse=Rt.defaultInstance.parse.bind(Rt.defaultInstance);Rt.registerClass=Rt.defaultInstance.registerClass.bind(Rt.defaultInstance);Rt.registerSymbol=Rt.defaultInstance.registerSymbol.bind(Rt.defaultInstance);Rt.registerCustom=Rt.defaultInstance.registerCustom.bind(Rt.defaultInstance);Rt.allowErrorProps=Rt.defaultInstance.allowErrorProps.bind(Rt.defaultInstance);const nk=Rt.parse;var vt;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(const s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(vt||(vt={}));var _w;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(_w||(_w={}));const Oe=vt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),so=e=>{switch(typeof e){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return isNaN(e)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(e)?Oe.array:e===null?Oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Oe.promise:typeof Map<"u"&&e instanceof Map?Oe.map:typeof Set<"u"&&e instanceof Set?Oe.set:typeof Date<"u"&&e instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},Se=vt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ire=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Tr extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,u=0;for(;u<s.path.length;){const c=s.path[u];u===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return i(this),r}static assert(t){if(!(t instanceof Tr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,vt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Tr.create=e=>new Tr(e);const Il=(e,t)=>{let n;switch(e.code){case Se.invalid_type:e.received===Oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Se.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,vt.jsonStringifyReplacer)}`;break;case Se.unrecognized_keys:n=`Unrecognized key(s) in object: ${vt.joinValues(e.keys,", ")}`;break;case Se.invalid_union:n="Invalid input";break;case Se.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${vt.joinValues(e.options)}`;break;case Se.invalid_enum_value:n=`Invalid enum value. Expected ${vt.joinValues(e.options)}, received '${e.received}'`;break;case Se.invalid_arguments:n="Invalid function arguments";break;case Se.invalid_return_type:n="Invalid function return type";break;case Se.invalid_date:n="Invalid date";break;case Se.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:vt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Se.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Se.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Se.custom:n="Invalid input";break;case Se.invalid_intersection_types:n="Intersection results could not be merged";break;case Se.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Se.not_finite:n="Number must be finite";break;default:n=t.defaultError,vt.assertNever(e)}return{message:n}};let tL=Il;function ore(e){tL=e}function Ap(){return tL}const Pp=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="";const u=r.filter(c=>!!c).slice().reverse();for(const c of u)a=c(s,{data:t,defaultError:a}).message;return{...i,path:o,message:a}},sre=[];function Pe(e,t){const n=Ap(),r=Pp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Il?void 0:Il].filter(i=>!!i)});e.common.issues.push(r)}class Hn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return nt;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,s=await i.value;r.push({key:o,value:s})}return Hn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return nt;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:t.value,value:r}}}const nt=Object.freeze({status:"aborted"}),ml=e=>({status:"dirty",value:e}),tr=e=>({status:"valid",value:e}),Nw=e=>e.status==="aborted",Tw=e=>e.status==="dirty",ca=e=>e.status==="valid",Qc=e=>typeof Promise<"u"&&e instanceof Promise;function Rp(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function nL(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var Ve;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ve||(Ve={}));var gc,yc;class zi{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const yT=(e,t)=>{if(ca(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Tr(e.common.issues);return this._error=n,this._error}}};function st(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,a)=>{var u,c;const{message:f}=e;return s.code==="invalid_enum_value"?{message:f??a.defaultError}:typeof a.data>"u"?{message:(u=f??r)!==null&&u!==void 0?u:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(c=f??n)!==null&&c!==void 0?c:a.defaultError}},description:i}}class ut{get description(){return this._def.description}_getType(t){return so(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:so(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Hn,ctx:{common:t.parent.common,data:t.data,parsedType:so(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Qc(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:so(t)},o=this._parseSync({data:t,path:i.path,parent:i});return yT(i,o)}"~validate"(t){var n,r;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:so(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:i});return ca(o)?{value:o.value}:{issues:i.common.issues}}catch(o){!((r=(n=o==null?void 0:o.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:i}).then(o=>ca(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:so(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(Qc(i)?i:Promise.resolve(i));return yT(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=t(i),a=()=>o.addIssue({code:Se.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new hi({schema:this,typeName:et.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Oi.create(this,this._def)}nullable(){return ws.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ar.create(this)}promise(){return zl.create(this,this._def)}or(t){return da.create([this,t],this._def)}and(t){return td.create(this,t,this._def)}transform(t){return new hi({...st(this._def),schema:this,typeName:et.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new od({...st(this._def),innerType:this,defaultValue:n,typeName:et.ZodDefault})}brand(){return new rk({typeName:et.ZodBranded,type:this,...st(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new sd({...st(this._def),innerType:this,catchValue:n,typeName:et.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Vd.create(this,t)}readonly(){return ad.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const are=/^c[^\s-]{8,}$/i,lre=/^[0-9a-z]+$/,ure=/^[0-9A-HJKMNP-TV-Z]{26}$/i,cre=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,dre=/^[a-z0-9_-]{21}$/i,fre=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,hre=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,pre=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,mre="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let nx;const gre=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,yre=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,vre=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,xre=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wre=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bre=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,rL="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",kre=new RegExp(`^${rL}$`);function iL(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Sre(e){return new RegExp(`^${iL(e)}$`)}function oL(e){let t=`${rL}T${iL(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Ere(e,t){return!!((t==="v4"||!t)&&gre.test(e)||(t==="v6"||!t)&&vre.test(e))}function Cre(e,t){if(!fre.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||!i.typ||!i.alg||t&&i.alg!==t)}catch{return!1}}function _re(e,t){return!!((t==="v4"||!t)&&yre.test(e)||(t==="v6"||!t)&&xre.test(e))}class si extends ut{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Oe.string){const o=this._getOrReturnCtx(t);return Pe(o,{code:Se.invalid_type,expected:Oe.string,received:o.parsedType}),nt}const r=new Hn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(t,i),s?Pe(i,{code:Se.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Pe(i,{code:Se.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")pre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"email",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")nx||(nx=new RegExp(mre,"u")),nx.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"emoji",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")cre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"uuid",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")dre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"nanoid",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")are.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"cuid",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")lre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"cuid2",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")ure.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"ulid",code:Se.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Pe(i,{validation:"url",code:Se.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"regex",code:Se.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?oL(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?kre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Sre(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?hre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"duration",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?Ere(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"ip",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?Cre(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"jwt",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?_re(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"cidr",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?wre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"base64",code:Se.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?bre.test(t.data)||(i=this._getOrReturnCtx(t,i),Pe(i,{validation:"base64url",code:Se.invalid_string,message:o.message}),r.dirty()):vt.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:Se.invalid_string,...Ve.errToObj(r)})}_addCheck(t){return new si({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ve.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ve.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ve.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ve.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ve.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ve.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ve.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ve.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ve.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ve.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ve.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ve.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ve.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...Ve.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ve.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ve.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ve.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ve.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ve.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ve.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ve.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ve.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ve.errToObj(n)})}nonempty(t){return this.min(1,Ve.errToObj(t))}trim(){return new si({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new si({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new si({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}si.create=e=>{var t;return new si({checks:[],typeName:et.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...st(e)})};function Nre(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),s=parseInt(t.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}class So extends ut{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Oe.number){const o=this._getOrReturnCtx(t);return Pe(o,{code:Se.invalid_type,expected:Oe.number,received:o.parsedType}),nt}let r;const i=new Hn;for(const o of this._def.checks)o.kind==="int"?vt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Nre(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.not_finite,message:o.message}),i.dirty()):vt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ve.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ve.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ve.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ve.toString(n))}setLimit(t,n,r,i){return new So({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ve.toString(i)}]})}_addCheck(t){return new So({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ve.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ve.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ve.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ve.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ve.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ve.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&vt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}So.create=e=>new So({checks:[],typeName:et.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...st(e)});class vs extends ut{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Oe.bigint)return this._getInvalidInput(t);let r;const i=new Hn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Pe(r,{code:Se.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):vt.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Pe(n,{code:Se.invalid_type,expected:Oe.bigint,received:n.parsedType}),nt}gte(t,n){return this.setLimit("min",t,!0,Ve.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ve.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ve.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ve.toString(n))}setLimit(t,n,r,i){return new vs({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ve.toString(i)}]})}_addCheck(t){return new vs({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ve.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ve.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}vs.create=e=>{var t;return new vs({checks:[],typeName:et.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...st(e)})};class jl extends ut{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Oe.boolean){const r=this._getOrReturnCtx(t);return Pe(r,{code:Se.invalid_type,expected:Oe.boolean,received:r.parsedType}),nt}return tr(t.data)}}jl.create=e=>new jl({typeName:et.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...st(e)});class xs extends ut{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Oe.date){const o=this._getOrReturnCtx(t);return Pe(o,{code:Se.invalid_type,expected:Oe.date,received:o.parsedType}),nt}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Pe(o,{code:Se.invalid_date}),nt}const r=new Hn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),Pe(i,{code:Se.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):vt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new xs({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ve.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ve.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}xs.create=e=>new xs({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:et.ZodDate,...st(e)});class Mp extends ut{_parse(t){if(this._getType(t)!==Oe.symbol){const r=this._getOrReturnCtx(t);return Pe(r,{code:Se.invalid_type,expected:Oe.symbol,received:r.parsedType}),nt}return tr(t.data)}}Mp.create=e=>new Mp({typeName:et.ZodSymbol,...st(e)});class Jc extends ut{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Pe(r,{code:Se.invalid_type,expected:Oe.undefined,received:r.parsedType}),nt}return tr(t.data)}}Jc.create=e=>new Jc({typeName:et.ZodUndefined,...st(e)});class ed extends ut{_parse(t){if(this._getType(t)!==Oe.null){const r=this._getOrReturnCtx(t);return Pe(r,{code:Se.invalid_type,expected:Oe.null,received:r.parsedType}),nt}return tr(t.data)}}ed.create=e=>new ed({typeName:et.ZodNull,...st(e)});class Ll extends ut{constructor(){super(...arguments),this._any=!0}_parse(t){return tr(t.data)}}Ll.create=e=>new Ll({typeName:et.ZodAny,...st(e)});class ia extends ut{constructor(){super(...arguments),this._unknown=!0}_parse(t){return tr(t.data)}}ia.create=e=>new ia({typeName:et.ZodUnknown,...st(e)});class Eo extends ut{_parse(t){const n=this._getOrReturnCtx(t);return Pe(n,{code:Se.invalid_type,expected:Oe.never,received:n.parsedType}),nt}}Eo.create=e=>new Eo({typeName:et.ZodNever,...st(e)});class Dp extends ut{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Pe(r,{code:Se.invalid_type,expected:Oe.void,received:r.parsedType}),nt}return tr(t.data)}}Dp.create=e=>new Dp({typeName:et.ZodVoid,...st(e)});class Ar extends ut{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Oe.array)return Pe(n,{code:Se.invalid_type,expected:Oe.array,received:n.parsedType}),nt;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Pe(n,{code:s?Se.too_big:Se.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Pe(n,{code:Se.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Pe(n,{code:Se.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new zi(n,s,n.path,a)))).then(s=>Hn.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new zi(n,s,n.path,a)));return Hn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Ar({...this._def,minLength:{value:t,message:Ve.toString(n)}})}max(t,n){return new Ar({...this._def,maxLength:{value:t,message:Ve.toString(n)}})}length(t,n){return new Ar({...this._def,exactLength:{value:t,message:Ve.toString(n)}})}nonempty(t){return this.min(1,t)}}Ar.create=(e,t)=>new Ar({type:e,minLength:null,maxLength:null,exactLength:null,typeName:et.ZodArray,...st(t)});function al(e){if(e instanceof Xt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Oi.create(al(r))}return new Xt({...e._def,shape:()=>t})}else return e instanceof Ar?new Ar({...e._def,type:al(e.element)}):e instanceof Oi?Oi.create(al(e.unwrap())):e instanceof ws?ws.create(al(e.unwrap())):e instanceof $i?$i.create(e.items.map(t=>al(t))):e}class Xt extends ut{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=vt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Oe.object){const c=this._getOrReturnCtx(t);return Pe(c,{code:Se.invalid_type,expected:Oe.object,received:c.parsedType}),nt}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Eo&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||a.push(c);const u=[];for(const c of s){const f=o[c],h=i.data[c];u.push({key:{status:"valid",value:c},value:f._parse(new zi(i,h,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Eo){const c=this._def.unknownKeys;if(c==="passthrough")for(const f of a)u.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(c==="strict")a.length>0&&(Pe(i,{code:Se.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const f of a){const h=i.data[f];u.push({key:{status:"valid",value:f},value:c._parse(new zi(i,h,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const f of u){const h=await f.key,p=await f.value;c.push({key:h,value:p,alwaysSet:f.alwaysSet})}return c}).then(c=>Hn.mergeObjectSync(r,c)):Hn.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return Ve.errToObj,new Xt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,s,a;const u=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ve.errToObj(t).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new Xt({...this._def,unknownKeys:"strip"})}passthrough(){return new Xt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Xt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Xt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:et.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Xt({...this._def,catchall:t})}pick(t){const n={};return vt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Xt({...this._def,shape:()=>n})}omit(t){const n={};return vt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Xt({...this._def,shape:()=>n})}deepPartial(){return al(this)}partial(t){const n={};return vt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Xt({...this._def,shape:()=>n})}required(t){const n={};return vt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Oi;)o=o._def.innerType;n[r]=o}}),new Xt({...this._def,shape:()=>n})}keyof(){return sL(vt.objectKeys(this.shape))}}Xt.create=(e,t)=>new Xt({shape:()=>e,unknownKeys:"strip",catchall:Eo.create(),typeName:et.ZodObject,...st(t)});Xt.strictCreate=(e,t)=>new Xt({shape:()=>e,unknownKeys:"strict",catchall:Eo.create(),typeName:et.ZodObject,...st(t)});Xt.lazycreate=(e,t)=>new Xt({shape:e,unknownKeys:"strip",catchall:Eo.create(),typeName:et.ZodObject,...st(t)});class da extends ut{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new Tr(a.ctx.common.issues));return Pe(n,{code:Se.invalid_union,unionErrors:s}),nt}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const u of r){const c={...n,common:{...n.common,issues:[]},parent:null},f=u._parseSync({data:n.data,path:n.path,parent:c});if(f.status==="valid")return f;f.status==="dirty"&&!o&&(o={result:f,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(u=>new Tr(u));return Pe(n,{code:Se.invalid_union,unionErrors:a}),nt}}get options(){return this._def.options}}da.create=(e,t)=>new da({options:e,typeName:et.ZodUnion,...st(t)});const oo=e=>e instanceof rd?oo(e.schema):e instanceof hi?oo(e.innerType()):e instanceof Fl?[e.value]:e instanceof Bi?e.options:e instanceof id?vt.objectValues(e.enum):e instanceof od?oo(e._def.innerType):e instanceof Jc?[void 0]:e instanceof ed?[null]:e instanceof Oi?[void 0,...oo(e.unwrap())]:e instanceof ws?[null,...oo(e.unwrap())]:e instanceof rk||e instanceof ad?oo(e.unwrap()):e instanceof sd?oo(e._def.innerType):[];class Im extends ut{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.object)return Pe(n,{code:Se.invalid_type,expected:Oe.object,received:n.parsedType}),nt;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Pe(n,{code:Se.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),nt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const s=oo(o.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,o)}}return new Im({typeName:et.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...st(r)})}}function Aw(e,t){const n=so(e),r=so(t);if(e===t)return{valid:!0,data:e};if(n===Oe.object&&r===Oe.object){const i=vt.objectKeys(t),o=vt.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(const a of o){const u=Aw(e[a],t[a]);if(!u.valid)return{valid:!1};s[a]=u.data}return{valid:!0,data:s}}else if(n===Oe.array&&r===Oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const s=e[o],a=t[o],u=Aw(s,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return n===Oe.date&&r===Oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class td extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,s)=>{if(Nw(o)||Nw(s))return nt;const a=Aw(o.value,s.value);return a.valid?((Tw(o)||Tw(s))&&n.dirty(),{status:n.value,value:a.data}):(Pe(r,{code:Se.invalid_intersection_types}),nt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}td.create=(e,t,n)=>new td({left:e,right:t,typeName:et.ZodIntersection,...st(n)});class $i extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.array)return Pe(r,{code:Se.invalid_type,expected:Oe.array,received:r.parsedType}),nt;if(r.data.length<this._def.items.length)return Pe(r,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),nt;!this._def.rest&&r.data.length>this._def.items.length&&(Pe(r,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const u=this._def.items[a]||this._def.rest;return u?u._parse(new zi(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>Hn.mergeArray(n,s)):Hn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new $i({...this._def,rest:t})}}$i.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $i({items:e,typeName:et.ZodTuple,rest:null,...st(t)})};class nd extends ut{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.object)return Pe(r,{code:Se.invalid_type,expected:Oe.object,received:r.parsedType}),nt;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new zi(r,a,r.path,a)),value:s._parse(new zi(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Hn.mergeObjectAsync(n,i):Hn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ut?new nd({keyType:t,valueType:n,typeName:et.ZodRecord,...st(r)}):new nd({keyType:si.create(),valueType:t,typeName:et.ZodRecord,...st(n)})}}class Op extends ut{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.map)return Pe(r,{code:Se.invalid_type,expected:Oe.map,received:r.parsedType}),nt;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,u],c)=>({key:i._parse(new zi(r,a,r.path,[c,"key"])),value:o._parse(new zi(r,u,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const u of s){const c=await u.key,f=await u.value;if(c.status==="aborted"||f.status==="aborted")return nt;(c.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(c.value,f.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const u of s){const c=u.key,f=u.value;if(c.status==="aborted"||f.status==="aborted")return nt;(c.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(c.value,f.value)}return{status:n.value,value:a}}}}Op.create=(e,t,n)=>new Op({valueType:t,keyType:e,typeName:et.ZodMap,...st(n)});class fa extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.set)return Pe(r,{code:Se.invalid_type,expected:Oe.set,received:r.parsedType}),nt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Pe(r,{code:Se.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Pe(r,{code:Se.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(u){const c=new Set;for(const f of u){if(f.status==="aborted")return nt;f.status==="dirty"&&n.dirty(),c.add(f.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((u,c)=>o._parse(new zi(r,u,r.path,c)));return r.common.async?Promise.all(a).then(u=>s(u)):s(a)}min(t,n){return new fa({...this._def,minSize:{value:t,message:Ve.toString(n)}})}max(t,n){return new fa({...this._def,maxSize:{value:t,message:Ve.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}fa.create=(e,t)=>new fa({valueType:e,minSize:null,maxSize:null,typeName:et.ZodSet,...st(t)});class El extends ut{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.function)return Pe(n,{code:Se.invalid_type,expected:Oe.function,received:n.parsedType}),nt;function r(a,u){return Pp({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ap(),Il].filter(c=>!!c),issueData:{code:Se.invalid_arguments,argumentsError:u}})}function i(a,u){return Pp({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ap(),Il].filter(c=>!!c),issueData:{code:Se.invalid_return_type,returnTypeError:u}})}const o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof zl){const a=this;return tr(async function(...u){const c=new Tr([]),f=await a._def.args.parseAsync(u,o).catch(m=>{throw c.addIssue(r(u,m)),c}),h=await Reflect.apply(s,this,f);return await a._def.returns._def.type.parseAsync(h,o).catch(m=>{throw c.addIssue(i(h,m)),c})})}else{const a=this;return tr(function(...u){const c=a._def.args.safeParse(u,o);if(!c.success)throw new Tr([r(u,c.error)]);const f=Reflect.apply(s,this,c.data),h=a._def.returns.safeParse(f,o);if(!h.success)throw new Tr([i(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new El({...this._def,args:$i.create(t).rest(ia.create())})}returns(t){return new El({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new El({args:t||$i.create([]).rest(ia.create()),returns:n||ia.create(),typeName:et.ZodFunction,...st(r)})}}class rd extends ut{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}rd.create=(e,t)=>new rd({getter:e,typeName:et.ZodLazy,...st(t)});class Fl extends ut{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Pe(n,{received:n.data,code:Se.invalid_literal,expected:this._def.value}),nt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Fl.create=(e,t)=>new Fl({value:e,typeName:et.ZodLiteral,...st(t)});function sL(e,t){return new Bi({values:e,typeName:et.ZodEnum,...st(t)})}class Bi extends ut{constructor(){super(...arguments),gc.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Pe(n,{expected:vt.joinValues(r),received:n.parsedType,code:Se.invalid_type}),nt}if(Rp(this,gc)||nL(this,gc,new Set(this._def.values)),!Rp(this,gc).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Pe(n,{received:n.data,code:Se.invalid_enum_value,options:r}),nt}return tr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Bi.create(t,{...this._def,...n})}exclude(t,n=this._def){return Bi.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}gc=new WeakMap;Bi.create=sL;class id extends ut{constructor(){super(...arguments),yc.set(this,void 0)}_parse(t){const n=vt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const i=vt.objectValues(n);return Pe(r,{expected:vt.joinValues(i),received:r.parsedType,code:Se.invalid_type}),nt}if(Rp(this,yc)||nL(this,yc,new Set(vt.getValidEnumValues(this._def.values))),!Rp(this,yc).has(t.data)){const i=vt.objectValues(n);return Pe(r,{received:r.data,code:Se.invalid_enum_value,options:i}),nt}return tr(t.data)}get enum(){return this._def.values}}yc=new WeakMap;id.create=(e,t)=>new id({values:e,typeName:et.ZodNativeEnum,...st(t)});class zl extends ut{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.promise&&n.common.async===!1)return Pe(n,{code:Se.invalid_type,expected:Oe.promise,received:n.parsedType}),nt;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return tr(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}zl.create=(e,t)=>new zl({type:e,typeName:et.ZodPromise,...st(t)});class hi extends ut{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===et.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:s=>{Pe(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return nt;const u=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return u.status==="aborted"?nt:u.status==="dirty"||n.value==="dirty"?ml(u.value):u});{if(n.value==="aborted")return nt;const a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?nt:a.status==="dirty"||n.value==="dirty"?ml(a.value):a}}if(i.type==="refinement"){const s=a=>{const u=i.refinement(a,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?nt:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?nt:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ca(s))return s;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>ca(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):s);vt.assertNever(i)}}hi.create=(e,t,n)=>new hi({schema:e,typeName:et.ZodEffects,effect:t,...st(n)});hi.createWithPreprocess=(e,t,n)=>new hi({schema:t,effect:{type:"preprocess",transform:e},typeName:et.ZodEffects,...st(n)});class Oi extends ut{_parse(t){return this._getType(t)===Oe.undefined?tr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Oi.create=(e,t)=>new Oi({innerType:e,typeName:et.ZodOptional,...st(t)});class ws extends ut{_parse(t){return this._getType(t)===Oe.null?tr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ws.create=(e,t)=>new ws({innerType:e,typeName:et.ZodNullable,...st(t)});class od extends ut{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}od.create=(e,t)=>new od({innerType:e,typeName:et.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...st(t)});class sd extends ut{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Qc(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Tr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Tr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}sd.create=(e,t)=>new sd({innerType:e,typeName:et.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...st(t)});class Ip extends ut{_parse(t){if(this._getType(t)!==Oe.nan){const r=this._getOrReturnCtx(t);return Pe(r,{code:Se.invalid_type,expected:Oe.nan,received:r.parsedType}),nt}return{status:"valid",value:t.data}}}Ip.create=e=>new Ip({typeName:et.ZodNaN,...st(e)});const Tre=Symbol("zod_brand");class rk extends ut{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Vd extends ut{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?nt:o.status==="dirty"?(n.dirty(),ml(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?nt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Vd({in:t,out:n,typeName:et.ZodPipeline})}}class ad extends ut{_parse(t){const n=this._def.innerType._parse(t),r=i=>(ca(i)&&(i.value=Object.freeze(i.value)),i);return Qc(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}ad.create=(e,t)=>new ad({innerType:e,typeName:et.ZodReadonly,...st(t)});function aL(e,t={},n){return e?Ll.create().superRefine((r,i)=>{var o,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(s=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&s!==void 0?s:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:u})}}):Ll.create()}const Are={object:Xt.lazycreate};var et;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(et||(et={}));const Pre=(e,t={message:`Input not instance of ${e.name}`})=>aL(n=>n instanceof e,t),lL=si.create,uL=So.create,Rre=Ip.create,Mre=vs.create,cL=jl.create,Dre=xs.create,Ore=Mp.create,Ire=Jc.create,jre=ed.create,Lre=Ll.create,Fre=ia.create,zre=Eo.create,$re=Dp.create,Bre=Ar.create,Vre=Xt.create,Wre=Xt.strictCreate,Ure=da.create,Hre=Im.create,Yre=td.create,qre=$i.create,Gre=nd.create,Zre=Op.create,Kre=fa.create,Xre=El.create,Qre=rd.create,Jre=Fl.create,eie=Bi.create,tie=id.create,nie=zl.create,vT=hi.create,rie=Oi.create,iie=ws.create,oie=hi.createWithPreprocess,sie=Vd.create,aie=()=>lL().optional(),lie=()=>uL().optional(),uie=()=>cL().optional(),cie={string:e=>si.create({...e,coerce:!0}),number:e=>So.create({...e,coerce:!0}),boolean:e=>jl.create({...e,coerce:!0}),bigint:e=>vs.create({...e,coerce:!0}),date:e=>xs.create({...e,coerce:!0})},die=nt;var Qt=Object.freeze({__proto__:null,defaultErrorMap:Il,setErrorMap:ore,getErrorMap:Ap,makeIssue:Pp,EMPTY_PATH:sre,addIssueToContext:Pe,ParseStatus:Hn,INVALID:nt,DIRTY:ml,OK:tr,isAborted:Nw,isDirty:Tw,isValid:ca,isAsync:Qc,get util(){return vt},get objectUtil(){return _w},ZodParsedType:Oe,getParsedType:so,ZodType:ut,datetimeRegex:oL,ZodString:si,ZodNumber:So,ZodBigInt:vs,ZodBoolean:jl,ZodDate:xs,ZodSymbol:Mp,ZodUndefined:Jc,ZodNull:ed,ZodAny:Ll,ZodUnknown:ia,ZodNever:Eo,ZodVoid:Dp,ZodArray:Ar,ZodObject:Xt,ZodUnion:da,ZodDiscriminatedUnion:Im,ZodIntersection:td,ZodTuple:$i,ZodRecord:nd,ZodMap:Op,ZodSet:fa,ZodFunction:El,ZodLazy:rd,ZodLiteral:Fl,ZodEnum:Bi,ZodNativeEnum:id,ZodPromise:zl,ZodEffects:hi,ZodTransformer:hi,ZodOptional:Oi,ZodNullable:ws,ZodDefault:od,ZodCatch:sd,ZodNaN:Ip,BRAND:Tre,ZodBranded:rk,ZodPipeline:Vd,ZodReadonly:ad,custom:aL,Schema:ut,ZodSchema:ut,late:Are,get ZodFirstPartyTypeKind(){return et},coerce:cie,any:Lre,array:Bre,bigint:Mre,boolean:cL,date:Dre,discriminatedUnion:Hre,effect:vT,enum:eie,function:Xre,instanceof:Pre,intersection:Yre,lazy:Qre,literal:Jre,map:Zre,nan:Rre,nativeEnum:tie,never:zre,null:jre,nullable:iie,number:uL,object:Vre,oboolean:uie,onumber:lie,optional:rie,ostring:aie,pipeline:sie,preprocess:oie,promise:nie,record:Gre,set:Kre,strictObject:Wre,string:lL,symbol:Ore,transformer:vT,tuple:qre,undefined:Ire,union:Ure,unknown:Fre,void:$re,NEVER:die,ZodIssueCode:Se,quotelessJson:ire,ZodError:Tr}),Wd=e=>e.type==="checkbox",Qs=e=>e instanceof Date,Qn=e=>e==null;const dL=e=>typeof e=="object";var an=e=>!Qn(e)&&!Array.isArray(e)&&dL(e)&&!Qs(e),fL=e=>an(e)&&e.target?Wd(e.target)?e.target.checked:e.target.value:e,fie=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,hL=(e,t)=>e.has(fie(t)),hie=e=>{const t=e.constructor&&e.constructor.prototype;return an(t)&&t.hasOwnProperty("isPrototypeOf")},ik=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function kn(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(ik&&(e instanceof Blob||r))&&(n||an(e)))if(t=n?[]:{},!n&&!hie(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=kn(e[i]));else return e;return t}var Ud=e=>Array.isArray(e)?e.filter(Boolean):[],$t=e=>e===void 0,Ne=(e,t,n)=>{if(!t||!an(e))return n;const r=Ud(t.split(/[,[\].]+?/)).reduce((i,o)=>Qn(i)?i:i[o],e);return $t(r)||r===e?$t(e[t])?n:e[t]:r},Br=e=>typeof e=="boolean",ok=e=>/^\w*$/.test(e),pL=e=>Ud(e.replace(/["|']|\]/g,"").split(/\.|\[/)),St=(e,t,n)=>{let r=-1;const i=ok(t)?[t]:pL(t),o=i.length,s=o-1;for(;++r<o;){const a=i[r];let u=n;if(r!==s){const c=e[a];u=an(c)||Array.isArray(c)?c:isNaN(+i[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=u,e=e[a]}return e};const jp={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Wr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ro={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},pie=ne.createContext(null),jm=()=>ne.useContext(pie);var mL=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const s=o;return t._proxyFormState[s]!==Wr.all&&(t._proxyFormState[s]=!r||Wr.all),n&&(n[s]=!0),e[s]}});return i},Xn=e=>an(e)&&!Object.keys(e).length,gL=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return Xn(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(s=>t[s]===(!r||Wr.all))},cr=e=>Array.isArray(e)?e:[e],yL=(e,t,n)=>!e||!t||e===t||cr(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Lm(e){const t=ne.useRef(e);t.current=e,ne.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function mie(e){const t=jm(),{control:n=t.control,disabled:r,name:i,exact:o}=e,[s,a]=ne.useState(n._formState),u=ne.useRef(!0),c=ne.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=ne.useRef(i);return f.current=i,Lm({disabled:r,next:h=>u.current&&yL(f.current,h.name,o)&&gL(h,c.current,n._updateFormState)&&a({...n._formState,...h}),subject:n._subjects.state}),ne.useEffect(()=>(u.current=!0,c.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),ne.useMemo(()=>mL(s,n,c.current,!1),[s,n])}var Ti=e=>typeof e=="string",vL=(e,t,n,r,i)=>Ti(e)?(r&&t.watch.add(e),Ne(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Ne(n,o))):(r&&(t.watchAll=!0),n);function gie(e){const t=jm(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:s}=e,a=ne.useRef(r);a.current=r,Lm({disabled:o,subject:n._subjects.values,next:f=>{yL(a.current,f.name,s)&&c(kn(vL(a.current,n._names,f.values||n._formValues,!1,i)))}});const[u,c]=ne.useState(n._getWatch(r,i));return ne.useEffect(()=>n._removeUnmounted()),u}function yie(e){const t=jm(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o}=e,s=hL(i._names.array,n),a=gie({control:i,name:n,defaultValue:Ne(i._formValues,n,Ne(i._defaultValues,n,e.defaultValue)),exact:!0}),u=mie({control:i,name:n,exact:!0}),c=ne.useRef(i.register(n,{...e.rules,value:a,...Br(e.disabled)?{disabled:e.disabled}:{}})),f=ne.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ne(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ne(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ne(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ne(u.validatingFields,n)},error:{enumerable:!0,get:()=>Ne(u.errors,n)}}),[u,n]),h=ne.useMemo(()=>({name:n,value:a,...Br(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:p=>c.current.onChange({target:{value:fL(p),name:n},type:jp.CHANGE}),onBlur:()=>c.current.onBlur({target:{value:Ne(i._formValues,n),name:n},type:jp.BLUR}),ref:p=>{const m=Ne(i._fields,n);m&&p&&(m._f.ref={focus:()=>p.focus(),select:()=>p.select(),setCustomValidity:y=>p.setCustomValidity(y),reportValidity:()=>p.reportValidity()})}}),[n,i._formValues,r,u.disabled,a,i._fields]);return ne.useEffect(()=>{const p=i._options.shouldUnregister||o,m=(y,x)=>{const k=Ne(i._fields,y);k&&k._f&&(k._f.mount=x)};if(m(n,!0),p){const y=kn(Ne(i._options.defaultValues,n));St(i._defaultValues,n,y),$t(Ne(i._formValues,n))&&St(i._formValues,n,y)}return!s&&i.register(n),()=>{(s?p&&!i._state.action:p)?i.unregister(n):m(n,!1)}},[n,i,s,o]),ne.useEffect(()=>{i._updateDisabledField({disabled:r,fields:i._fields,name:n})},[r,n,i]),ne.useMemo(()=>({field:h,formState:u,fieldState:f}),[h,u,f])}const uu=e=>e.render(yie(e));var xL=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},es=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},rx=(e,t,n={})=>n.shouldFocus||$t(n.shouldFocus)?n.focusName||`${e}.${$t(n.focusIndex)?t:n.focusIndex}.`:"",Ac=e=>({isOnSubmit:!e||e===Wr.onSubmit,isOnBlur:e===Wr.onBlur,isOnChange:e===Wr.onChange,isOnAll:e===Wr.all,isOnTouch:e===Wr.onTouched}),Pw=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Cl=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=Ne(e,i);if(o){const{_f:s,...a}=o;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],i)&&!r)return!0;if(s.ref&&t(s.ref,s.name)&&!r)return!0;if(Cl(a,t))break}else if(an(a)&&Cl(a,t))break}}};var wL=(e,t,n)=>{const r=cr(Ne(e,n));return St(r,"root",t[n]),St(e,n,r),e},sk=e=>e.type==="file",Ni=e=>typeof e=="function",Lp=e=>{if(!ik)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Jh=e=>Ti(e),ak=e=>e.type==="radio",Fp=e=>e instanceof RegExp;const xT={value:!1,isValid:!1},wT={value:!0,isValid:!0};var bL=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!$t(e[0].attributes.value)?$t(e[0].value)||e[0].value===""?wT:{value:e[0].value,isValid:!0}:wT:xT}return xT};const bT={isValid:!1,value:null};var kL=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,bT):bT;function kT(e,t,n="validate"){if(Jh(e)||Array.isArray(e)&&e.every(Jh)||Br(e)&&!e)return{type:n,message:Jh(e)?e:"",ref:t}}var il=e=>an(e)&&!Fp(e)?e:{value:e,message:""},Rw=async(e,t,n,r,i,o)=>{const{ref:s,refs:a,required:u,maxLength:c,minLength:f,min:h,max:p,pattern:m,validate:y,name:x,valueAsNumber:k,mount:w}=e._f,E=Ne(n,x);if(!w||t.has(x))return{};const C=a?a[0]:s,N=F=>{i&&C.reportValidity&&(C.setCustomValidity(Br(F)?"":F||""),C.reportValidity())},P={},A=ak(s),O=Wd(s),M=A||O,j=(k||sk(s))&&$t(s.value)&&$t(E)||Lp(s)&&s.value===""||E===""||Array.isArray(E)&&!E.length,R=xL.bind(null,x,r,P),$=(F,H,I,Y=ro.maxLength,q=ro.minLength)=>{const Z=F?H:I;P[x]={type:F?Y:q,message:Z,ref:s,...R(F?Y:q,Z)}};if(o?!Array.isArray(E)||!E.length:u&&(!M&&(j||Qn(E))||Br(E)&&!E||O&&!bL(a).isValid||A&&!kL(a).isValid)){const{value:F,message:H}=Jh(u)?{value:!!u,message:u}:il(u);if(F&&(P[x]={type:ro.required,message:H,ref:C,...R(ro.required,H)},!r))return N(H),P}if(!j&&(!Qn(h)||!Qn(p))){let F,H;const I=il(p),Y=il(h);if(!Qn(E)&&!isNaN(E)){const q=s.valueAsNumber||E&&+E;Qn(I.value)||(F=q>I.value),Qn(Y.value)||(H=q<Y.value)}else{const q=s.valueAsDate||new Date(E),Z=L=>new Date(new Date().toDateString()+" "+L),B=s.type=="time",W=s.type=="week";Ti(I.value)&&E&&(F=B?Z(E)>Z(I.value):W?E>I.value:q>new Date(I.value)),Ti(Y.value)&&E&&(H=B?Z(E)<Z(Y.value):W?E<Y.value:q<new Date(Y.value))}if((F||H)&&($(!!F,I.message,Y.message,ro.max,ro.min),!r))return N(P[x].message),P}if((c||f)&&!j&&(Ti(E)||o&&Array.isArray(E))){const F=il(c),H=il(f),I=!Qn(F.value)&&E.length>+F.value,Y=!Qn(H.value)&&E.length<+H.value;if((I||Y)&&($(I,F.message,H.message),!r))return N(P[x].message),P}if(m&&!j&&Ti(E)){const{value:F,message:H}=il(m);if(Fp(F)&&!E.match(F)&&(P[x]={type:ro.pattern,message:H,ref:s,...R(ro.pattern,H)},!r))return N(H),P}if(y){if(Ni(y)){const F=await y(E,n),H=kT(F,C);if(H&&(P[x]={...H,...R(ro.validate,H.message)},!r))return N(H.message),P}else if(an(y)){let F={};for(const H in y){if(!Xn(F)&&!r)break;const I=kT(await y[H](E,n),C,H);I&&(F={...I,...R(H,I.message)},N(I.message),r&&(P[x]=F))}if(!Xn(F)&&(P[x]={ref:C,...F},!r))return P}}return N(!0),P},ix=(e,t)=>[...e,...cr(t)],ox=e=>Array.isArray(e)?e.map(()=>{}):void 0;function sx(e,t,n){return[...e.slice(0,t),...cr(n),...e.slice(t)]}var ax=(e,t,n)=>Array.isArray(e)?($t(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],lx=(e,t)=>[...cr(t),...cr(e)];function vie(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return Ud(r).length?r:[]}var ux=(e,t)=>$t(t)?[]:vie(e,cr(t).sort((n,r)=>n-r)),cx=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]};function xie(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=$t(e)?r++:e[t[r++]];return e}function wie(e){for(const t in e)if(e.hasOwnProperty(t)&&!$t(e[t]))return!1;return!0}function cn(e,t){const n=Array.isArray(t)?t:ok(t)?[t]:pL(t),r=n.length===1?e:xie(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(an(r)&&Xn(r)||Array.isArray(r)&&wie(r))&&cn(e,n.slice(0,-1)),e}var ST=(e,t,n)=>(e[t]=n,e);function lk(e){const t=jm(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:o,rules:s}=e,[a,u]=ne.useState(n._getFieldArray(r)),c=ne.useRef(n._getFieldArray(r).map(es)),f=ne.useRef(a),h=ne.useRef(r),p=ne.useRef(!1);h.current=r,f.current=a,n._names.array.add(r),s&&n.register(r,s),Lm({next:({values:A,name:O})=>{if(O===h.current||!O){const M=Ne(A,h.current);Array.isArray(M)&&(u(M),c.current=M.map(es))}},subject:n._subjects.array});const m=ne.useCallback(A=>{p.current=!0,n._updateFieldArray(r,A)},[n,r]),y=(A,O)=>{const M=cr(kn(A)),j=ix(n._getFieldArray(r),M);n._names.focus=rx(r,j.length-1,O),c.current=ix(c.current,M.map(es)),m(j),u(j),n._updateFieldArray(r,j,ix,{argA:ox(A)})},x=(A,O)=>{const M=cr(kn(A)),j=lx(n._getFieldArray(r),M);n._names.focus=rx(r,0,O),c.current=lx(c.current,M.map(es)),m(j),u(j),n._updateFieldArray(r,j,lx,{argA:ox(A)})},k=A=>{const O=ux(n._getFieldArray(r),A);c.current=ux(c.current,A),m(O),u(O),!Array.isArray(Ne(n._fields,r))&&St(n._fields,r,void 0),n._updateFieldArray(r,O,ux,{argA:A})},w=(A,O,M)=>{const j=cr(kn(O)),R=sx(n._getFieldArray(r),A,j);n._names.focus=rx(r,A,M),c.current=sx(c.current,A,j.map(es)),m(R),u(R),n._updateFieldArray(r,R,sx,{argA:A,argB:ox(O)})},E=(A,O)=>{const M=n._getFieldArray(r);cx(M,A,O),cx(c.current,A,O),m(M),u(M),n._updateFieldArray(r,M,cx,{argA:A,argB:O},!1)},C=(A,O)=>{const M=n._getFieldArray(r);ax(M,A,O),ax(c.current,A,O),m(M),u(M),n._updateFieldArray(r,M,ax,{argA:A,argB:O},!1)},N=(A,O)=>{const M=kn(O),j=ST(n._getFieldArray(r),A,M);c.current=[...j].map((R,$)=>!R||$===A?es():c.current[$]),m(j),u([...j]),n._updateFieldArray(r,j,ST,{argA:A,argB:M},!0,!1)},P=A=>{const O=cr(kn(A));c.current=O.map(es),m([...O]),u([...O]),n._updateFieldArray(r,[...O],M=>M,{},!0,!1)};return ne.useEffect(()=>{if(n._state.action=!1,Pw(r,n._names)&&n._subjects.state.next({...n._formState}),p.current&&(!Ac(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(A=>{const O=Ne(A.errors,r),M=Ne(n._formState.errors,r);(M?!O&&M.type||O&&(M.type!==O.type||M.message!==O.message):O&&O.type)&&(O?St(n._formState.errors,r,O):cn(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const A=Ne(n._fields,r);A&&A._f&&!(Ac(n._options.reValidateMode).isOnSubmit&&Ac(n._options.mode).isOnSubmit)&&Rw(A,n._names.disabled,n._formValues,n._options.criteriaMode===Wr.all,n._options.shouldUseNativeValidation,!0).then(O=>!Xn(O)&&n._subjects.state.next({errors:wL(n._formState.errors,O,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&Cl(n._fields,(A,O)=>{if(n._names.focus&&O.startsWith(n._names.focus)&&A.focus)return A.focus(),1}),n._names.focus="",n._updateValid(),p.current=!1},[a,r,n]),ne.useEffect(()=>(!Ne(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||o)&&n.unregister(r)}),[r,n,i,o]),{swap:ne.useCallback(E,[m,r,n]),move:ne.useCallback(C,[m,r,n]),prepend:ne.useCallback(x,[m,r,n]),append:ne.useCallback(y,[m,r,n]),remove:ne.useCallback(k,[m,r,n]),insert:ne.useCallback(w,[m,r,n]),update:ne.useCallback(N,[m,r,n]),replace:ne.useCallback(P,[m,r,n]),fields:ne.useMemo(()=>a.map((A,O)=>({...A,[i]:c.current[O]||es()})),[a,i])}}var dx=()=>{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}},Mw=e=>Qn(e)||!dL(e);function as(e,t){if(Mw(e)||Mw(t))return e===t;if(Qs(e)&&Qs(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const s=t[i];if(Qs(o)&&Qs(s)||an(o)&&an(s)||Array.isArray(o)&&Array.isArray(s)?!as(o,s):o!==s)return!1}}return!0}var SL=e=>e.type==="select-multiple",bie=e=>ak(e)||Wd(e),fx=e=>Lp(e)&&e.isConnected,EL=e=>{for(const t in e)if(Ni(e[t]))return!0;return!1};function zp(e,t={}){const n=Array.isArray(e);if(an(e)||n)for(const r in e)Array.isArray(e[r])||an(e[r])&&!EL(e[r])?(t[r]=Array.isArray(e[r])?[]:{},zp(e[r],t[r])):Qn(e[r])||(t[r]=!0);return t}function CL(e,t,n){const r=Array.isArray(e);if(an(e)||r)for(const i in e)Array.isArray(e[i])||an(e[i])&&!EL(e[i])?$t(t)||Mw(n[i])?n[i]=Array.isArray(e[i])?zp(e[i],[]):{...zp(e[i])}:CL(e[i],Qn(t)?{}:t[i],n[i]):n[i]=!as(e[i],t[i]);return n}var ic=(e,t)=>CL(e,t,zp(t)),_L=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>$t(e)?e:t?e===""?NaN:e&&+e:n&&Ti(e)?new Date(e):r?r(e):e;function hx(e){const t=e.ref;return sk(t)?t.files:ak(t)?kL(e.refs).value:SL(t)?[...t.selectedOptions].map(({value:n})=>n):Wd(t)?bL(e.refs).value:_L($t(t.value)?e.ref.value:t.value,e)}var kie=(e,t,n,r)=>{const i={};for(const o of e){const s=Ne(t,o);s&&St(i,o,s._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},oc=e=>$t(e)?e:Fp(e)?e.source:an(e)?Fp(e.value)?e.value.source:e.value:e;const ET="AsyncFunction";var Sie=e=>!!e&&!!e.validate&&!!(Ni(e.validate)&&e.validate.constructor.name===ET||an(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===ET)),Eie=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function CT(e,t,n){const r=Ne(e,n);if(r||ok(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),s=Ne(t,o),a=Ne(e,o);if(s&&!Array.isArray(s)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};i.pop()}return{name:n}}var Cie=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,_ie=(e,t)=>!Ud(Ne(e,t)).length&&cn(e,t);const Nie={mode:Wr.onSubmit,reValidateMode:Wr.onChange,shouldFocusError:!0};function Tie(e={}){let t={...Nie,...e},n={submitCount:0,isDirty:!1,isLoading:Ni(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=an(t.defaultValues)||an(t.values)?kn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:kn(i),s={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={values:dx(),array:dx(),state:dx()},p=Ac(t.mode),m=Ac(t.reValidateMode),y=t.criteriaMode===Wr.all,x=Q=>oe=>{clearTimeout(c),c=setTimeout(Q,oe)},k=async Q=>{if(!t.disabled&&(f.isValid||Q)){const oe=t.resolver?Xn((await M()).errors):await R(r,!0);oe!==n.isValid&&h.state.next({isValid:oe})}},w=(Q,oe)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((Q||Array.from(a.mount)).forEach(ae=>{ae&&(oe?St(n.validatingFields,ae,oe):cn(n.validatingFields,ae))}),h.state.next({validatingFields:n.validatingFields,isValidating:!Xn(n.validatingFields)}))},E=(Q,oe=[],ae,Ce,ke=!0,ge=!0)=>{if(Ce&&ae&&!t.disabled){if(s.action=!0,ge&&Array.isArray(Ne(r,Q))){const Ae=ae(Ne(r,Q),Ce.argA,Ce.argB);ke&&St(r,Q,Ae)}if(ge&&Array.isArray(Ne(n.errors,Q))){const Ae=ae(Ne(n.errors,Q),Ce.argA,Ce.argB);ke&&St(n.errors,Q,Ae),_ie(n.errors,Q)}if(f.touchedFields&&ge&&Array.isArray(Ne(n.touchedFields,Q))){const Ae=ae(Ne(n.touchedFields,Q),Ce.argA,Ce.argB);ke&&St(n.touchedFields,Q,Ae)}f.dirtyFields&&(n.dirtyFields=ic(i,o)),h.state.next({name:Q,isDirty:F(Q,oe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else St(o,Q,oe)},C=(Q,oe)=>{St(n.errors,Q,oe),h.state.next({errors:n.errors})},N=Q=>{n.errors=Q,h.state.next({errors:n.errors,isValid:!1})},P=(Q,oe,ae,Ce)=>{const ke=Ne(r,Q);if(ke){const ge=Ne(o,Q,$t(ae)?Ne(i,Q):ae);$t(ge)||Ce&&Ce.defaultChecked||oe?St(o,Q,oe?ge:hx(ke._f)):Y(Q,ge),s.mount&&k()}},A=(Q,oe,ae,Ce,ke)=>{let ge=!1,Ae=!1;const Fe={name:Q};if(!t.disabled){const ce=!!(Ne(r,Q)&&Ne(r,Q)._f&&Ne(r,Q)._f.disabled);if(!ae||Ce){f.isDirty&&(Ae=n.isDirty,n.isDirty=Fe.isDirty=F(),ge=Ae!==Fe.isDirty);const pe=ce||as(Ne(i,Q),oe);Ae=!!(!ce&&Ne(n.dirtyFields,Q)),pe||ce?cn(n.dirtyFields,Q):St(n.dirtyFields,Q,!0),Fe.dirtyFields=n.dirtyFields,ge=ge||f.dirtyFields&&Ae!==!pe}if(ae){const pe=Ne(n.touchedFields,Q);pe||(St(n.touchedFields,Q,ae),Fe.touchedFields=n.touchedFields,ge=ge||f.touchedFields&&pe!==ae)}ge&&ke&&h.state.next(Fe)}return ge?Fe:{}},O=(Q,oe,ae,Ce)=>{const ke=Ne(n.errors,Q),ge=f.isValid&&Br(oe)&&n.isValid!==oe;if(t.delayError&&ae?(u=x(()=>C(Q,ae)),u(t.delayError)):(clearTimeout(c),u=null,ae?St(n.errors,Q,ae):cn(n.errors,Q)),(ae?!as(ke,ae):ke)||!Xn(Ce)||ge){const Ae={...Ce,...ge&&Br(oe)?{isValid:oe}:{},errors:n.errors,name:Q};n={...n,...Ae},h.state.next(Ae)}},M=async Q=>{w(Q,!0);const oe=await t.resolver(o,t.context,kie(Q||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(Q),oe},j=async Q=>{const{errors:oe}=await M(Q);if(Q)for(const ae of Q){const Ce=Ne(oe,ae);Ce?St(n.errors,ae,Ce):cn(n.errors,ae)}else n.errors=oe;return oe},R=async(Q,oe,ae={valid:!0})=>{for(const Ce in Q){const ke=Q[Ce];if(ke){const{_f:ge,...Ae}=ke;if(ge){const Fe=a.array.has(ge.name),ce=ke._f&&Sie(ke._f);ce&&f.validatingFields&&w([Ce],!0);const pe=await Rw(ke,a.disabled,o,y,t.shouldUseNativeValidation&&!oe,Fe);if(ce&&f.validatingFields&&w([Ce]),pe[ge.name]&&(ae.valid=!1,oe))break;!oe&&(Ne(pe,ge.name)?Fe?wL(n.errors,pe,ge.name):St(n.errors,ge.name,pe[ge.name]):cn(n.errors,ge.name))}!Xn(Ae)&&await R(Ae,oe,ae)}}return ae.valid},$=()=>{for(const Q of a.unMount){const oe=Ne(r,Q);oe&&(oe._f.refs?oe._f.refs.every(ae=>!fx(ae)):!fx(oe._f.ref))&&J(Q)}a.unMount=new Set},F=(Q,oe)=>!t.disabled&&(Q&&oe&&St(o,Q,oe),!as(U(),i)),H=(Q,oe,ae)=>vL(Q,a,{...s.mount?o:$t(oe)?i:Ti(Q)?{[Q]:oe}:oe},ae,oe),I=Q=>Ud(Ne(s.mount?o:i,Q,t.shouldUnregister?Ne(i,Q,[]):[])),Y=(Q,oe,ae={})=>{const Ce=Ne(r,Q);let ke=oe;if(Ce){const ge=Ce._f;ge&&(!ge.disabled&&St(o,Q,_L(oe,ge)),ke=Lp(ge.ref)&&Qn(oe)?"":oe,SL(ge.ref)?[...ge.ref.options].forEach(Ae=>Ae.selected=ke.includes(Ae.value)):ge.refs?Wd(ge.ref)?ge.refs.length>1?ge.refs.forEach(Ae=>(!Ae.defaultChecked||!Ae.disabled)&&(Ae.checked=Array.isArray(ke)?!!ke.find(Fe=>Fe===Ae.value):ke===Ae.value)):ge.refs[0]&&(ge.refs[0].checked=!!ke):ge.refs.forEach(Ae=>Ae.checked=Ae.value===ke):sk(ge.ref)?ge.ref.value="":(ge.ref.value=ke,ge.ref.type||h.values.next({name:Q,values:{...o}})))}(ae.shouldDirty||ae.shouldTouch)&&A(Q,ke,ae.shouldTouch,ae.shouldDirty,!0),ae.shouldValidate&&L(Q)},q=(Q,oe,ae)=>{for(const Ce in oe){const ke=oe[Ce],ge=`${Q}.${Ce}`,Ae=Ne(r,ge);(a.array.has(Q)||an(ke)||Ae&&!Ae._f)&&!Qs(ke)?q(ge,ke,ae):Y(ge,ke,ae)}},Z=(Q,oe,ae={})=>{const Ce=Ne(r,Q),ke=a.array.has(Q),ge=kn(oe);St(o,Q,ge),ke?(h.array.next({name:Q,values:{...o}}),(f.isDirty||f.dirtyFields)&&ae.shouldDirty&&h.state.next({name:Q,dirtyFields:ic(i,o),isDirty:F(Q,ge)})):Ce&&!Ce._f&&!Qn(ge)?q(Q,ge,ae):Y(Q,ge,ae),Pw(Q,a)&&h.state.next({...n}),h.values.next({name:s.mount?Q:void 0,values:{...o}})},B=async Q=>{s.mount=!0;const oe=Q.target;let ae=oe.name,Ce=!0;const ke=Ne(r,ae),ge=()=>oe.type?hx(ke._f):fL(Q),Ae=Fe=>{Ce=Number.isNaN(Fe)||Qs(Fe)&&isNaN(Fe.getTime())||as(Fe,Ne(o,ae,Fe))};if(ke){let Fe,ce;const pe=ge(),Ie=Q.type===jp.BLUR||Q.type===jp.FOCUS_OUT,Ke=!Eie(ke._f)&&!t.resolver&&!Ne(n.errors,ae)&&!ke._f.deps||Cie(Ie,Ne(n.touchedFields,ae),n.isSubmitted,m,p),tt=Pw(ae,a,Ie);St(o,ae,pe),Ie?(ke._f.onBlur&&ke._f.onBlur(Q),u&&u(0)):ke._f.onChange&&ke._f.onChange(Q);const At=A(ae,pe,Ie,!1),He=!Xn(At)||tt;if(!Ie&&h.values.next({name:ae,type:Q.type,values:{...o}}),Ke)return f.isValid&&(t.mode==="onBlur"&&Ie?k():Ie||k()),He&&h.state.next({name:ae,...tt?{}:At});if(!Ie&&tt&&h.state.next({...n}),t.resolver){const{errors:it}=await M([ae]);if(Ae(pe),Ce){const at=CT(n.errors,r,ae),Wt=CT(it,r,at.name||ae);Fe=Wt.error,ae=Wt.name,ce=Xn(it)}}else w([ae],!0),Fe=(await Rw(ke,a.disabled,o,y,t.shouldUseNativeValidation))[ae],w([ae]),Ae(pe),Ce&&(Fe?ce=!1:f.isValid&&(ce=await R(r,!0)));Ce&&(ke._f.deps&&L(ke._f.deps),O(ae,ce,Fe,At))}},W=(Q,oe)=>{if(Ne(n.errors,oe)&&Q.focus)return Q.focus(),1},L=async(Q,oe={})=>{let ae,Ce;const ke=cr(Q);if(t.resolver){const ge=await j($t(Q)?Q:ke);ae=Xn(ge),Ce=Q?!ke.some(Ae=>Ne(ge,Ae)):ae}else Q?(Ce=(await Promise.all(ke.map(async ge=>{const Ae=Ne(r,ge);return await R(Ae&&Ae._f?{[ge]:Ae}:Ae)}))).every(Boolean),!(!Ce&&!n.isValid)&&k()):Ce=ae=await R(r);return h.state.next({...!Ti(Q)||f.isValid&&ae!==n.isValid?{}:{name:Q},...t.resolver||!Q?{isValid:ae}:{},errors:n.errors}),oe.shouldFocus&&!Ce&&Cl(r,W,Q?ke:a.mount),Ce},U=Q=>{const oe={...s.mount?o:i};return $t(Q)?oe:Ti(Q)?Ne(oe,Q):Q.map(ae=>Ne(oe,ae))},V=(Q,oe)=>({invalid:!!Ne((oe||n).errors,Q),isDirty:!!Ne((oe||n).dirtyFields,Q),error:Ne((oe||n).errors,Q),isValidating:!!Ne(n.validatingFields,Q),isTouched:!!Ne((oe||n).touchedFields,Q)}),D=Q=>{Q&&cr(Q).forEach(oe=>cn(n.errors,oe)),h.state.next({errors:Q?n.errors:{}})},G=(Q,oe,ae)=>{const Ce=(Ne(r,Q,{_f:{}})._f||{}).ref,ke=Ne(n.errors,Q)||{},{ref:ge,message:Ae,type:Fe,...ce}=ke;St(n.errors,Q,{...ce,...oe,ref:Ce}),h.state.next({name:Q,errors:n.errors,isValid:!1}),ae&&ae.shouldFocus&&Ce&&Ce.focus&&Ce.focus()},K=(Q,oe)=>Ni(Q)?h.values.subscribe({next:ae=>Q(H(void 0,oe),ae)}):H(Q,oe,!0),J=(Q,oe={})=>{for(const ae of Q?cr(Q):a.mount)a.mount.delete(ae),a.array.delete(ae),oe.keepValue||(cn(r,ae),cn(o,ae)),!oe.keepError&&cn(n.errors,ae),!oe.keepDirty&&cn(n.dirtyFields,ae),!oe.keepTouched&&cn(n.touchedFields,ae),!oe.keepIsValidating&&cn(n.validatingFields,ae),!t.shouldUnregister&&!oe.keepDefaultValue&&cn(i,ae);h.values.next({values:{...o}}),h.state.next({...n,...oe.keepDirty?{isDirty:F()}:{}}),!oe.keepIsValid&&k()},ee=({disabled:Q,name:oe,field:ae,fields:Ce})=>{(Br(Q)&&s.mount||Q||a.disabled.has(oe))&&(Q?a.disabled.add(oe):a.disabled.delete(oe),A(oe,hx(ae?ae._f:Ne(Ce,oe)._f),!1,!1,!0))},re=(Q,oe={})=>{let ae=Ne(r,Q);const Ce=Br(oe.disabled)||Br(t.disabled);return St(r,Q,{...ae||{},_f:{...ae&&ae._f?ae._f:{ref:{name:Q}},name:Q,mount:!0,...oe}}),a.mount.add(Q),ae?ee({field:ae,disabled:Br(oe.disabled)?oe.disabled:t.disabled,name:Q}):P(Q,!0,oe.value),{...Ce?{disabled:oe.disabled||t.disabled}:{},...t.progressive?{required:!!oe.required,min:oc(oe.min),max:oc(oe.max),minLength:oc(oe.minLength),maxLength:oc(oe.maxLength),pattern:oc(oe.pattern)}:{},name:Q,onChange:B,onBlur:B,ref:ke=>{if(ke){re(Q,oe),ae=Ne(r,Q);const ge=$t(ke.value)&&ke.querySelectorAll&&ke.querySelectorAll("input,select,textarea")[0]||ke,Ae=bie(ge),Fe=ae._f.refs||[];if(Ae?Fe.find(ce=>ce===ge):ge===ae._f.ref)return;St(r,Q,{_f:{...ae._f,...Ae?{refs:[...Fe.filter(fx),ge,...Array.isArray(Ne(i,Q))?[{}]:[]],ref:{type:ge.type,name:Q}}:{ref:ge}}}),P(Q,!1,void 0,ge)}else ae=Ne(r,Q,{}),ae._f&&(ae._f.mount=!1),(t.shouldUnregister||oe.shouldUnregister)&&!(hL(a.array,Q)&&s.action)&&a.unMount.add(Q)}}},ue=()=>t.shouldFocusError&&Cl(r,W,a.mount),he=Q=>{Br(Q)&&(h.state.next({disabled:Q}),Cl(r,(oe,ae)=>{const Ce=Ne(r,ae);Ce&&(oe.disabled=Ce._f.disabled||Q,Array.isArray(Ce._f.refs)&&Ce._f.refs.forEach(ke=>{ke.disabled=Ce._f.disabled||Q}))},0,!1))},be=(Q,oe)=>async ae=>{let Ce;ae&&(ae.preventDefault&&ae.preventDefault(),ae.persist&&ae.persist());let ke=kn(o);if(a.disabled.size)for(const ge of a.disabled)St(ke,ge,void 0);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:ge,values:Ae}=await M();n.errors=ge,ke=Ae}else await R(r);if(cn(n.errors,"root"),Xn(n.errors)){h.state.next({errors:{}});try{await Q(ke,ae)}catch(ge){Ce=ge}}else oe&&await oe({...n.errors},ae),ue(),setTimeout(ue);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Xn(n.errors)&&!Ce,submitCount:n.submitCount+1,errors:n.errors}),Ce)throw Ce},fe=(Q,oe={})=>{Ne(r,Q)&&($t(oe.defaultValue)?Z(Q,kn(Ne(i,Q))):(Z(Q,oe.defaultValue),St(i,Q,kn(oe.defaultValue))),oe.keepTouched||cn(n.touchedFields,Q),oe.keepDirty||(cn(n.dirtyFields,Q),n.isDirty=oe.defaultValue?F(Q,kn(Ne(i,Q))):F()),oe.keepError||(cn(n.errors,Q),f.isValid&&k()),h.state.next({...n}))},ve=(Q,oe={})=>{const ae=Q?kn(Q):i,Ce=kn(ae),ke=Xn(Q),ge=ke?i:Ce;if(oe.keepDefaultValues||(i=ae),!oe.keepValues){if(oe.keepDirtyValues){const Ae=new Set([...a.mount,...Object.keys(ic(i,o))]);for(const Fe of Array.from(Ae))Ne(n.dirtyFields,Fe)?St(ge,Fe,Ne(o,Fe)):Z(Fe,Ne(ge,Fe))}else{if(ik&&$t(Q))for(const Ae of a.mount){const Fe=Ne(r,Ae);if(Fe&&Fe._f){const ce=Array.isArray(Fe._f.refs)?Fe._f.refs[0]:Fe._f.ref;if(Lp(ce)){const pe=ce.closest("form");if(pe){pe.reset();break}}}}r={}}o=t.shouldUnregister?oe.keepDefaultValues?kn(i):{}:kn(ge),h.array.next({values:{...ge}}),h.values.next({values:{...ge}})}a={mount:oe.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!f.isValid||!!oe.keepIsValid||!!oe.keepDirtyValues,s.watch=!!t.shouldUnregister,h.state.next({submitCount:oe.keepSubmitCount?n.submitCount:0,isDirty:ke?!1:oe.keepDirty?n.isDirty:!!(oe.keepDefaultValues&&!as(Q,i)),isSubmitted:oe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ke?{}:oe.keepDirtyValues?oe.keepDefaultValues&&o?ic(i,o):n.dirtyFields:oe.keepDefaultValues&&Q?ic(i,Q):oe.keepDirty?n.dirtyFields:{},touchedFields:oe.keepTouched?n.touchedFields:{},errors:oe.keepErrors?n.errors:{},isSubmitSuccessful:oe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Me=(Q,oe)=>ve(Ni(Q)?Q(o):Q,oe);return{control:{register:re,unregister:J,getFieldState:V,handleSubmit:be,setError:G,_executeSchema:M,_getWatch:H,_getDirty:F,_updateValid:k,_removeUnmounted:$,_updateFieldArray:E,_updateDisabledField:ee,_getFieldArray:I,_reset:ve,_resetDefaultValues:()=>Ni(t.defaultValues)&&t.defaultValues().then(Q=>{Me(Q,t.resetOptions),h.state.next({isLoading:!1})}),_updateFormState:Q=>{n={...n,...Q}},_disableForm:he,_subjects:h,_proxyFormState:f,_setErrors:N,get _fields(){return r},get _formValues(){return o},get _state(){return s},set _state(Q){s=Q},get _defaultValues(){return i},get _names(){return a},set _names(Q){a=Q},get _formState(){return n},set _formState(Q){n=Q},get _options(){return t},set _options(Q){t={...t,...Q}}},trigger:L,register:re,handleSubmit:be,watch:K,setValue:Z,getValues:U,reset:Me,resetField:fe,clearErrors:D,unregister:J,setError:G,setFocus:(Q,oe={})=>{const ae=Ne(r,Q),Ce=ae&&ae._f;if(Ce){const ke=Ce.refs?Ce.refs[0]:Ce.ref;ke.focus&&(ke.focus(),oe.shouldSelect&&Ni(ke.select)&&ke.select())}},getFieldState:V}}function Aie(e={}){const t=ne.useRef(void 0),n=ne.useRef(void 0),[r,i]=ne.useState({isDirty:!1,isValidating:!1,isLoading:Ni(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Ni(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Tie(e),formState:r});const o=t.current.control;return o._options=e,Lm({subject:o._subjects.state,next:s=>{gL(s,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),ne.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),ne.useEffect(()=>{if(o._proxyFormState.isDirty){const s=o._getDirty();s!==r.isDirty&&o._subjects.state.next({isDirty:s})}},[o,r.isDirty]),ne.useEffect(()=>{e.values&&!as(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,i(s=>({...s}))):o._resetDefaultValues()},[e.values,o]),ne.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),ne.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),ne.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=mL(r,o),t.current}const _T=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Ne(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},NL=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?_T(r.ref,n,e):r.refs&&r.refs.forEach(i=>_T(i,n,e))}},Pie=(e,t)=>{t.shouldUseNativeValidation&&NL(e,t);const n={};for(const r in e){const i=Ne(t.fields,r),o=Object.assign(e[r]||{},{ref:i&&i.ref});if(Rie(t.names||Object.keys(e),r)){const s=Object.assign({},Ne(n,r));St(s,"root",o),St(n,r,s)}else St(n,r,o)}return n},Rie=(e,t)=>e.some(n=>n.startsWith(t+"."));var Mie=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,o=r.message,s=r.path.join(".");if(!n[s])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[s]={message:a.message,type:a.code}}else n[s]={message:o,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(h){return e.push(h)})}),t){var u=n[s].types,c=u&&u[r.code];n[s]=xL(s,t,n,i,c?[].concat(c,r.message):r.message)}e.shift()}return n},Die=function(e,t,n){return n===void 0&&(n={}),function(r,i,o){try{return Promise.resolve(function(s,a){try{var u=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return o.shouldUseNativeValidation&&NL({},o),{errors:{},values:n.raw?r:c}})}catch(c){return a(c)}return u&&u.then?u.then(void 0,a):u}(0,function(s){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(s))return{values:{},errors:Pie(Mie(s.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw s}))}catch(s){return Promise.reject(s)}}};const Oie=e=>{const t={};return e.errors.forEach(n=>{if(n.path.length>0){const r=n.path.join(".");t[r]={type:"validation",message:n.message}}}),t};function uk(e){return Function("z",`"use strict";return (${e});`)(Qt)}const Iie=(e,t)=>async n=>{var s,a;const r=((a=(s=e==null?void 0:e._def)==null?void 0:s.options)==null?void 0:a.find(u=>{var c,f,h;return((h=(f=(c=u==null?void 0:u.shape)==null?void 0:c[t])==null?void 0:f._def)==null?void 0:h.value)===n[t]}))||Qt.object({[t]:Qt.string()}),i=Object.fromEntries(Object.entries(n).filter(([u])=>{var c;return(c=r==null?void 0:r.shape)==null?void 0:c[u]})),o=r.safeParse(i);if(o.success)return{values:o.data,errors:{}};{const u=Oie(o.error);return{values:{},errors:u}}};function jie({name:e,control:t,renderField:n}){const{fields:r,append:i,remove:o}=lk({control:t,name:e});return v.jsxs("div",{className:"space-y-2",children:[r.map((s,a)=>v.jsxs("div",{className:"relative flex items-center gap-2",children:[n({fieldName:`${e}.${a}`,index:a}),v.jsx(Bt,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-2 -top-2",onClick:()=>o(a),children:v.jsx(va,{className:"h-4 w-4"})})]},s.id)),v.jsxs(Bt,{type:"button",variant:"outline",size:"sm",className:"w-full",onClick:()=>i({}),children:[v.jsx(jc,{className:"mr-2 h-4 w-4"}),"Add Item"]})]})}function TL(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ck="Switch",[Lie,Cve]=Yr(ck),[Fie,zie]=Lie(ck),AL=S.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:u="on",onCheckedChange:c,form:f,...h}=e,[p,m]=S.useState(null),y=pt(t,C=>m(C)),x=S.useRef(!1),k=p?f||!!p.closest("form"):!0,[w=!1,E]=wo({prop:i,defaultProp:o,onChange:c});return v.jsxs(Fie,{scope:n,checked:w,disabled:a,children:[v.jsx(Ue.button,{type:"button",role:"switch","aria-checked":w,"aria-required":s,"data-state":ML(w),"data-disabled":a?"":void 0,disabled:a,value:u,...h,ref:y,onClick:Re(e.onClick,C=>{E(N=>!N),k&&(x.current=C.isPropagationStopped(),x.current||C.stopPropagation())})}),k&&v.jsx($ie,{control:p,bubbles:!x.current,name:r,value:u,checked:w,required:s,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});AL.displayName=ck;var PL="SwitchThumb",RL=S.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=zie(PL,n);return v.jsx(Ue.span,{"data-state":ML(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});RL.displayName=PL;var $ie=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=S.useRef(null),s=TL(n),a=xI(t);return S.useEffect(()=>{const u=o.current,c=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&h){const p=new Event("click",{bubbles:r});h.call(u,n),u.dispatchEvent(p)}},[s,n,r]),v.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ML(e){return e?"checked":"unchecked"}var DL=AL,Bie=RL;const OL=S.forwardRef(({className:e,...t},n)=>v.jsx(DL,{className:Te("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-mastra-bg-7 data-[state=unchecked]:bg-input",e),...t,ref:n,children:v.jsx(Bie,{className:Te("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));OL.displayName=DL.displayName;function Vie({name:e,control:t,handleFieldChange:n}){return v.jsx(uu,{name:e,control:t,render:({field:r})=>v.jsx(OL,{checked:r.value,onCheckedChange:i=>{r.onChange(i),n==null||n({key:e,value:i})}})})}const Wie=nu("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Uie({className:e,variant:t,...n}){return v.jsx("div",{className:Te(Wie({variant:t}),e),...n})}var NT=1,Hie=.9,Yie=.8,qie=.17,px=.1,mx=.999,Gie=.9999,Zie=.99,Kie=/[\\\/_+.#"@\[\(\{&]/,Xie=/[\\\/_+.#"@\[\(\{&]/g,Qie=/[\s-]/,IL=/[\s-]/g;function Dw(e,t,n,r,i,o,s){if(o===t.length)return i===e.length?NT:Zie;var a=`${i},${o}`;if(s[a]!==void 0)return s[a];for(var u=r.charAt(o),c=n.indexOf(u,i),f=0,h,p,m,y;c>=0;)h=Dw(e,t,n,r,c+1,o+1,s),h>f&&(c===i?h*=NT:Kie.test(e.charAt(c-1))?(h*=Yie,m=e.slice(i,c-1).match(Xie),m&&i>0&&(h*=Math.pow(mx,m.length))):Qie.test(e.charAt(c-1))?(h*=Hie,y=e.slice(i,c-1).match(IL),y&&i>0&&(h*=Math.pow(mx,y.length))):(h*=qie,i>0&&(h*=Math.pow(mx,c-i))),e.charAt(c)!==t.charAt(o)&&(h*=Gie)),(h<px&&n.charAt(c-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(c-1)!==r.charAt(o))&&(p=Dw(e,t,n,r,c+1,o+2,s),p*px>h&&(h=p*px)),h>f&&(f=h),c=n.indexOf(u,c+1);return s[a]=f,f}function TT(e){return e.toLowerCase().replace(IL," ")}function Jie(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Dw(e,t,TT(e),TT(t),0,0,{})}var sc='[cmdk-group=""]',gx='[cmdk-group-items=""]',eoe='[cmdk-group-heading=""]',dk='[cmdk-item=""]',AT=`${dk}:not([aria-disabled="true"])`,Ow="cmdk-item-select",Ks="data-value",toe=(e,t,n)=>Jie(e,t,n),jL=S.createContext(void 0),Hd=()=>S.useContext(jL),LL=S.createContext(void 0),fk=()=>S.useContext(LL),FL=S.createContext(void 0),zL=S.forwardRef((e,t)=>{let n=ll(()=>{var V,D;return{search:"",value:(D=(V=e.value)!=null?V:e.defaultValue)!=null?D:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=ll(()=>new Set),i=ll(()=>new Map),o=ll(()=>new Map),s=ll(()=>new Set),a=$L(e),{label:u,children:c,value:f,onValueChange:h,filter:p,shouldFilter:m,loop:y,disablePointerSelection:x=!1,vimBindings:k=!0,...w}=e,E=En(),C=En(),N=En(),P=S.useRef(null),A=foe();ha(()=>{if(f!==void 0){let V=f.trim();n.current.value=V,O.emit()}},[f]),ha(()=>{A(6,H)},[]);let O=S.useMemo(()=>({subscribe:V=>(s.current.add(V),()=>s.current.delete(V)),snapshot:()=>n.current,setState:(V,D,G)=>{var K,J,ee;if(!Object.is(n.current[V],D)){if(n.current[V]=D,V==="search")F(),R(),A(1,$);else if(V==="value"&&(G||A(5,H),((K=a.current)==null?void 0:K.value)!==void 0)){let re=D??"";(ee=(J=a.current).onValueChange)==null||ee.call(J,re);return}O.emit()}},emit:()=>{s.current.forEach(V=>V())}}),[]),M=S.useMemo(()=>({value:(V,D,G)=>{var K;D!==((K=o.current.get(V))==null?void 0:K.value)&&(o.current.set(V,{value:D,keywords:G}),n.current.filtered.items.set(V,j(D,G)),A(2,()=>{R(),O.emit()}))},item:(V,D)=>(r.current.add(V),D&&(i.current.has(D)?i.current.get(D).add(V):i.current.set(D,new Set([V]))),A(3,()=>{F(),R(),n.current.value||$(),O.emit()}),()=>{o.current.delete(V),r.current.delete(V),n.current.filtered.items.delete(V);let G=I();A(4,()=>{F(),(G==null?void 0:G.getAttribute("id"))===V&&$(),O.emit()})}),group:V=>(i.current.has(V)||i.current.set(V,new Set),()=>{o.current.delete(V),i.current.delete(V)}),filter:()=>a.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:E,inputId:N,labelId:C,listInnerRef:P}),[]);function j(V,D){var G,K;let J=(K=(G=a.current)==null?void 0:G.filter)!=null?K:toe;return V?J(V,n.current.search,D):0}function R(){if(!n.current.search||a.current.shouldFilter===!1)return;let V=n.current.filtered.items,D=[];n.current.filtered.groups.forEach(K=>{let J=i.current.get(K),ee=0;J.forEach(re=>{let ue=V.get(re);ee=Math.max(ue,ee)}),D.push([K,ee])});let G=P.current;Y().sort((K,J)=>{var ee,re;let ue=K.getAttribute("id"),he=J.getAttribute("id");return((ee=V.get(he))!=null?ee:0)-((re=V.get(ue))!=null?re:0)}).forEach(K=>{let J=K.closest(gx);J?J.appendChild(K.parentElement===J?K:K.closest(`${gx} > *`)):G.appendChild(K.parentElement===G?K:K.closest(`${gx} > *`))}),D.sort((K,J)=>J[1]-K[1]).forEach(K=>{var J;let ee=(J=P.current)==null?void 0:J.querySelector(`${sc}[${Ks}="${encodeURIComponent(K[0])}"]`);ee==null||ee.parentElement.appendChild(ee)})}function $(){let V=Y().find(G=>G.getAttribute("aria-disabled")!=="true"),D=V==null?void 0:V.getAttribute(Ks);O.setState("value",D||void 0)}function F(){var V,D,G,K;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let J=0;for(let ee of r.current){let re=(D=(V=o.current.get(ee))==null?void 0:V.value)!=null?D:"",ue=(K=(G=o.current.get(ee))==null?void 0:G.keywords)!=null?K:[],he=j(re,ue);n.current.filtered.items.set(ee,he),he>0&&J++}for(let[ee,re]of i.current)for(let ue of re)if(n.current.filtered.items.get(ue)>0){n.current.filtered.groups.add(ee);break}n.current.filtered.count=J}function H(){var V,D,G;let K=I();K&&(((V=K.parentElement)==null?void 0:V.firstChild)===K&&((G=(D=K.closest(sc))==null?void 0:D.querySelector(eoe))==null||G.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function I(){var V;return(V=P.current)==null?void 0:V.querySelector(`${dk}[aria-selected="true"]`)}function Y(){var V;return Array.from(((V=P.current)==null?void 0:V.querySelectorAll(AT))||[])}function q(V){let D=Y()[V];D&&O.setState("value",D.getAttribute(Ks))}function Z(V){var D;let G=I(),K=Y(),J=K.findIndex(re=>re===G),ee=K[J+V];(D=a.current)!=null&&D.loop&&(ee=J+V<0?K[K.length-1]:J+V===K.length?K[0]:K[J+V]),ee&&O.setState("value",ee.getAttribute(Ks))}function B(V){let D=I(),G=D==null?void 0:D.closest(sc),K;for(;G&&!K;)G=V>0?coe(G,sc):doe(G,sc),K=G==null?void 0:G.querySelector(AT);K?O.setState("value",K.getAttribute(Ks)):Z(V)}let W=()=>q(Y().length-1),L=V=>{V.preventDefault(),V.metaKey?W():V.altKey?B(1):Z(1)},U=V=>{V.preventDefault(),V.metaKey?q(0):V.altKey?B(-1):Z(-1)};return S.createElement(Ue.div,{ref:t,tabIndex:-1,...w,"cmdk-root":"",onKeyDown:V=>{var D;if((D=w.onKeyDown)==null||D.call(w,V),!V.defaultPrevented)switch(V.key){case"n":case"j":{k&&V.ctrlKey&&L(V);break}case"ArrowDown":{L(V);break}case"p":case"k":{k&&V.ctrlKey&&U(V);break}case"ArrowUp":{U(V);break}case"Home":{V.preventDefault(),q(0);break}case"End":{V.preventDefault(),W();break}case"Enter":if(!V.nativeEvent.isComposing&&V.keyCode!==229){V.preventDefault();let G=I();if(G){let K=new Event(Ow);G.dispatchEvent(K)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:poe},u),Fm(e,V=>S.createElement(LL.Provider,{value:O},S.createElement(jL.Provider,{value:M},V))))}),noe=S.forwardRef((e,t)=>{var n,r;let i=En(),o=S.useRef(null),s=S.useContext(FL),a=Hd(),u=$L(e),c=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;ha(()=>{if(!c)return a.item(i,s==null?void 0:s.id)},[c]);let f=BL(i,o,[e.value,e.children,o],e.keywords),h=fk(),p=pa(A=>A.value&&A.value===f.current),m=pa(A=>c||a.filter()===!1?!0:A.search?A.filtered.items.get(i)>0:!0);S.useEffect(()=>{let A=o.current;if(!(!A||e.disabled))return A.addEventListener(Ow,y),()=>A.removeEventListener(Ow,y)},[m,e.onSelect,e.disabled]);function y(){var A,O;x(),(O=(A=u.current).onSelect)==null||O.call(A,f.current)}function x(){h.setState("value",f.current,!0)}if(!m)return null;let{disabled:k,value:w,onSelect:E,forceMount:C,keywords:N,...P}=e;return S.createElement(Ue.div,{ref:ld([o,t]),...P,id:i,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!p,"data-disabled":!!k,"data-selected":!!p,onPointerMove:k||a.getDisablePointerSelection()?void 0:x,onClick:k?void 0:y},e.children)}),roe=S.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=En(),a=S.useRef(null),u=S.useRef(null),c=En(),f=Hd(),h=pa(m=>i||f.filter()===!1?!0:m.search?m.filtered.groups.has(s):!0);ha(()=>f.group(s),[]),BL(s,a,[e.value,e.heading,u]);let p=S.useMemo(()=>({id:s,forceMount:i}),[i]);return S.createElement(Ue.div,{ref:ld([a,t]),...o,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},n&&S.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),Fm(e,m=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},S.createElement(FL.Provider,{value:p},m))))}),ioe=S.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=S.useRef(null),o=pa(s=>!s.search);return!n&&!o?null:S.createElement(Ue.div,{ref:ld([i,t]),...r,"cmdk-separator":"",role:"separator"})}),ooe=S.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=fk(),s=pa(f=>f.search),a=pa(f=>f.value),u=Hd(),c=S.useMemo(()=>{var f;let h=(f=u.listInnerRef.current)==null?void 0:f.querySelector(`${dk}[${Ks}="${encodeURIComponent(a)}"]`);return h==null?void 0:h.getAttribute("id")},[]);return S.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),S.createElement(Ue.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":c,id:u.inputId,type:"text",value:i?e.value:s,onChange:f=>{i||o.setState("search",f.target.value),n==null||n(f.target.value)}})}),soe=S.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=S.useRef(null),s=S.useRef(null),a=Hd();return S.useEffect(()=>{if(s.current&&o.current){let u=s.current,c=o.current,f,h=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let p=u.offsetHeight;c.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(f),h.unobserve(u)}}},[]),S.createElement(Ue.div,{ref:ld([o,t]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},Fm(e,u=>S.createElement("div",{ref:ld([s,a.listInnerRef]),"cmdk-list-sizer":""},u)))}),aoe=S.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...a}=e;return S.createElement(RO,{open:n,onOpenChange:r},S.createElement(MO,{container:s},S.createElement(DO,{"cmdk-overlay":"",className:i}),S.createElement(OO,{"aria-label":e.label,"cmdk-dialog":"",className:o},S.createElement(zL,{ref:t,...a}))))}),loe=S.forwardRef((e,t)=>pa(n=>n.filtered.count===0)?S.createElement(Ue.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),uoe=S.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return S.createElement(Ue.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Fm(e,s=>S.createElement("div",{"aria-hidden":!0},s)))}),hr=Object.assign(zL,{List:soe,Item:noe,Input:ooe,Group:roe,Separator:ioe,Dialog:aoe,Empty:loe,Loading:uoe});function coe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function doe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $L(e){let t=S.useRef(e);return ha(()=>{t.current=e}),t}var ha=typeof window>"u"?S.useEffect:S.useLayoutEffect;function ll(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function ld(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function pa(e){let t=fk(),n=()=>e(t.snapshot());return IR.useSyncExternalStore(t.subscribe,n,n)}function BL(e,t,n,r=[]){let i=S.useRef(),o=Hd();return ha(()=>{var s;let a=(()=>{var c;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(c=f.current.textContent)==null?void 0:c.trim():i.current}})(),u=r.map(c=>c.trim());o.value(e,a,u),(s=t.current)==null||s.setAttribute(Ks,a),i.current=a}),i}var foe=()=>{let[e,t]=S.useState(),n=ll(()=>new Map);return ha(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function hoe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Fm({asChild:e,children:t},n){return e&&S.isValidElement(t)?S.cloneElement(hoe(t),{ref:t.ref},n(t.props.children)):n(t)}var poe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const VL=S.forwardRef(({className:e,...t},n)=>v.jsx(hr,{ref:n,className:Te("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));VL.displayName=hr.displayName;const WL=S.forwardRef(({className:e,...t},n)=>v.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[v.jsx(KB,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),v.jsx(hr.Input,{ref:n,className:Te("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));WL.displayName=hr.Input.displayName;const UL=S.forwardRef(({className:e,...t},n)=>v.jsx(hr.List,{ref:n,className:Te("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));UL.displayName=hr.List.displayName;const moe=S.forwardRef((e,t)=>v.jsx(hr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));moe.displayName=hr.Empty.displayName;const HL=S.forwardRef(({className:e,...t},n)=>v.jsx(hr.Group,{ref:n,className:Te("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));HL.displayName=hr.Group.displayName;const goe=S.forwardRef(({className:e,...t},n)=>v.jsx(hr.Separator,{ref:n,className:Te("-mx-1 h-px bg-border",e),...t}));goe.displayName=hr.Separator.displayName;const Iw=S.forwardRef(({className:e,...t},n)=>v.jsx(hr.Item,{ref:n,className:Te("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Iw.displayName=hr.Item.displayName;var hk="Popover",[YL,_ve]=Yr(hk,[lu]),Yd=lu(),[yoe,_s]=YL(hk),qL=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,a=Yd(t),u=S.useRef(null),[c,f]=S.useState(!1),[h=!1,p]=wo({prop:r,defaultProp:i,onChange:o});return v.jsx(Rm,{...a,children:v.jsx(yoe,{scope:t,contentId:En(),triggerRef:u,open:h,onOpenChange:p,onOpenToggle:S.useCallback(()=>p(m=>!m),[p]),hasCustomAnchor:c,onCustomAnchorAdd:S.useCallback(()=>f(!0),[]),onCustomAnchorRemove:S.useCallback(()=>f(!1),[]),modal:s,children:n})})};qL.displayName=hk;var GL="PopoverAnchor",voe=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=_s(GL,n),o=Yd(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=i;return S.useEffect(()=>(s(),()=>a()),[s,a]),v.jsx(Mm,{...o,...r,ref:t})});voe.displayName=GL;var ZL="PopoverTrigger",KL=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=_s(ZL,n),o=Yd(n),s=pt(t,i.triggerRef),a=v.jsx(Ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":tF(i.open),...r,ref:s,onClick:Re(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:v.jsx(Mm,{asChild:!0,...o,children:a})});KL.displayName=ZL;var pk="PopoverPortal",[xoe,woe]=YL(pk,{forceMount:void 0}),XL=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=_s(pk,t);return v.jsx(xoe,{scope:t,forceMount:n,children:v.jsx(nr,{present:n||o.open,children:v.jsx(jd,{asChild:!0,container:i,children:r})})})};XL.displayName=pk;var $l="PopoverContent",QL=S.forwardRef((e,t)=>{const n=woe($l,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=_s($l,e.__scopePopover);return v.jsx(nr,{present:r||o.open,children:o.modal?v.jsx(boe,{...i,ref:t}):v.jsx(koe,{...i,ref:t})})});QL.displayName=$l;var boe=S.forwardRef((e,t)=>{const n=_s($l,e.__scopePopover),r=S.useRef(null),i=pt(t,r),o=S.useRef(!1);return S.useEffect(()=>{const s=r.current;if(s)return Nm(s)},[]),v.jsx(Ld,{as:Li,allowPinchZoom:!0,children:v.jsx(JL,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0,c=a.button===2||u;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Re(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),koe=S.forwardRef((e,t)=>{const n=_s($l,e.__scopePopover),r=S.useRef(!1),i=S.useRef(!1);return v.jsx(JL,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),JL=S.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:f,...h}=e,p=_s($l,n),m=Yd(n);return Cm(),v.jsx(Id,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:v.jsx(Od,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:v.jsx(U1,{"data-state":tF(p.open),role:"dialog",id:p.contentId,...m,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),eF="PopoverClose",Soe=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=_s(eF,n);return v.jsx(Ue.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>i.onOpenChange(!1))})});Soe.displayName=eF;var Eoe="PopoverArrow",Coe=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Yd(n);return v.jsx(H1,{...i,...r,ref:t})});Coe.displayName=Eoe;function tF(e){return e?"open":"closed"}var _oe=qL,Noe=KL,Toe=XL,nF=QL;const rF=_oe,iF=Noe,mk=S.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>v.jsx(Toe,{children:v.jsx(nF,{ref:i,align:t,sideOffset:n,className:Te("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));mk.displayName=nF.displayName;function PT({name:e,control:t,options:n=[],handleFieldChange:r,placeholder:i}){const[o,s]=S.useState(!1),[a,u]=S.useState("");return v.jsx(uu,{name:e,control:t,render:({field:c})=>{const f=c.value||[],h=m=>{const y=f.filter(x=>x!==m);c.onChange(y),r==null||r({key:e,value:y})},p=m=>{if(!m)return;const y=[...f,m];c.onChange(y),r==null||r({key:e,value:y}),u(""),s(!1)};return v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(m=>v.jsxs(Uie,{className:"flex items-center gap-1",children:[m,v.jsx(Bt,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",onClick:()=>h(m),children:v.jsx(va,{className:"h-3 w-3"})})]},m))}),v.jsxs(rF,{open:o,onOpenChange:s,children:[v.jsx(iF,{asChild:!0,children:v.jsxs(Bt,{variant:"outline",size:"sm",className:"w-full justify-start",children:[v.jsx(jc,{className:"mr-2 h-4 w-4"}),i||"Add item"]})}),v.jsx(mk,{className:"p-0",align:"start",children:v.jsxs(VL,{children:[v.jsx(WL,{placeholder:"Enter value...",value:a,onValueChange:u}),v.jsx(UL,{children:v.jsxs(HL,{children:[n.filter(m=>!f.includes(m.value)).map(m=>v.jsx(Iw,{onSelect:()=>p(m.value),children:m.label},m.value)),a&&v.jsxs(Iw,{onSelect:()=>p(a),children:['Create "',a,'"']})]})})]})})]})]})}})}const oF=6048e5,Aoe=864e5,RT=Symbol.for("constructDateFrom");function Rn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&RT in e?e[RT](t):e instanceof Date?new e.constructor(t):new Date(t)}function It(e,t){return Rn(t||e,e)}function sF(e,t,n){const r=It(e,n==null?void 0:n.in);return isNaN(t)?Rn(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function aF(e,t,n){const r=It(e,n==null?void 0:n.in);if(isNaN(t))return Rn(e,NaN);if(!t)return r;const i=r.getDate(),o=Rn(e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const s=o.getDate();return i>=s?o:(r.setFullYear(o.getFullYear(),o.getMonth(),i),r)}let Poe={};function qd(){return Poe}function Bl(e,t){var a,u,c,f;const n=qd(),r=(t==null?void 0:t.weekStartsOn)??((u=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(c=n.locale)==null?void 0:c.options)==null?void 0:f.weekStartsOn)??0,i=It(e,t==null?void 0:t.in),o=i.getDay(),s=(o<r?7:0)+o-r;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function ud(e,t){return Bl(e,{...t,weekStartsOn:1})}function lF(e,t){const n=It(e,t==null?void 0:t.in),r=n.getFullYear(),i=Rn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const o=ud(i),s=Rn(n,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const a=ud(s);return n.getTime()>=o.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function MT(e){const t=It(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Gd(e,...t){const n=Rn.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function cd(e,t){const n=It(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function uF(e,t,n){const[r,i]=Gd(n==null?void 0:n.in,e,t),o=cd(r),s=cd(i),a=+o-MT(o),u=+s-MT(s);return Math.round((a-u)/Aoe)}function Roe(e,t){const n=lF(e,t),r=Rn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ud(r)}function Moe(e,t,n){return sF(e,t*7,n)}function Doe(e,t,n){return aF(e,t*12,n)}function Ooe(e,t){let n,r=t==null?void 0:t.in;return e.forEach(i=>{!r&&typeof i=="object"&&(r=Rn.bind(null,i));const o=It(i,r);(!n||n<o||isNaN(+o))&&(n=o)}),Rn(r,n||NaN)}function Ioe(e,t){let n,r=t==null?void 0:t.in;return e.forEach(i=>{!r&&typeof i=="object"&&(r=Rn.bind(null,i));const o=It(i,r);(!n||n>o||isNaN(+o))&&(n=o)}),Rn(r,n||NaN)}function joe(e,t,n){const[r,i]=Gd(n==null?void 0:n.in,e,t);return+cd(r)==+cd(i)}function cF(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function dF(e){return!(!cF(e)&&typeof e!="number"||isNaN(+It(e)))}function Loe(e,t,n){const[r,i]=Gd(n==null?void 0:n.in,e,t),o=r.getFullYear()-i.getFullYear(),s=r.getMonth()-i.getMonth();return o*12+s}function Foe(e,t){const n=It(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function zoe(e,t){const n=It(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function $oe(e,t){const n=It(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function fF(e,t){const n=It(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function hF(e,t){var a,u,c,f;const n=qd(),r=(t==null?void 0:t.weekStartsOn)??((u=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(c=n.locale)==null?void 0:c.options)==null?void 0:f.weekStartsOn)??0,i=It(e,t==null?void 0:t.in),o=i.getDay(),s=(o<r?-7:0)+6-(o-r);return i.setDate(i.getDate()+s),i.setHours(23,59,59,999),i}function Boe(e,t){return hF(e,{...t,weekStartsOn:1})}const Voe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Woe=(e,t,n)=>{let r;const i=Voe[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function yx(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Uoe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Hoe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Yoe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},qoe={date:yx({formats:Uoe,defaultWidth:"full"}),time:yx({formats:Hoe,defaultWidth:"full"}),dateTime:yx({formats:Yoe,defaultWidth:"full"})},Goe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Zoe=(e,t,n,r)=>Goe[e];function ac(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[s]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const Koe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xoe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Qoe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Joe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ese={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},tse={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},nse=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},rse={ordinalNumber:nse,era:ac({values:Koe,defaultWidth:"wide"}),quarter:ac({values:Xoe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ac({values:Qoe,defaultWidth:"wide"}),day:ac({values:Joe,defaultWidth:"wide"}),dayPeriod:ac({values:ese,defaultWidth:"wide",formattingValues:tse,defaultFormattingWidth:"wide"})};function lc(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(a)?ose(a,h=>h.test(s)):ise(a,h=>h.test(s));let c;c=e.valueCallback?e.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;const f=t.slice(s.length);return{value:c,rest:f}}}function ise(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ose(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function sse(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let s=e.valueCallback?e.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(i.length);return{value:s,rest:a}}}const ase=/^(\d+)(th|st|nd|rd)?/i,lse=/\d+/i,use={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},cse={any:[/^b/i,/^(a|c)/i]},dse={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fse={any:[/1/i,/2/i,/3/i,/4/i]},hse={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},pse={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},mse={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},gse={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},yse={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},vse={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},xse={ordinalNumber:sse({matchPattern:ase,parsePattern:lse,valueCallback:e=>parseInt(e,10)}),era:lc({matchPatterns:use,defaultMatchWidth:"wide",parsePatterns:cse,defaultParseWidth:"any"}),quarter:lc({matchPatterns:dse,defaultMatchWidth:"wide",parsePatterns:fse,defaultParseWidth:"any",valueCallback:e=>e+1}),month:lc({matchPatterns:hse,defaultMatchWidth:"wide",parsePatterns:pse,defaultParseWidth:"any"}),day:lc({matchPatterns:mse,defaultMatchWidth:"wide",parsePatterns:gse,defaultParseWidth:"any"}),dayPeriod:lc({matchPatterns:yse,defaultMatchWidth:"any",parsePatterns:vse,defaultParseWidth:"any"})},zm={code:"en-US",formatDistance:Woe,formatLong:qoe,formatRelative:Zoe,localize:rse,match:xse,options:{weekStartsOn:0,firstWeekContainsDate:1}};function wse(e,t){const n=It(e,t==null?void 0:t.in);return uF(n,fF(n))+1}function pF(e,t){const n=It(e,t==null?void 0:t.in),r=+ud(n)-+Roe(n);return Math.round(r/oF)+1}function mF(e,t){var f,h,p,m;const n=It(e,t==null?void 0:t.in),r=n.getFullYear(),i=qd(),o=(t==null?void 0:t.firstWeekContainsDate)??((h=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((m=(p=i.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,s=Rn((t==null?void 0:t.in)||e,0);s.setFullYear(r+1,0,o),s.setHours(0,0,0,0);const a=Bl(s,t),u=Rn((t==null?void 0:t.in)||e,0);u.setFullYear(r,0,o),u.setHours(0,0,0,0);const c=Bl(u,t);return+n>=+a?r+1:+n>=+c?r:r-1}function bse(e,t){var a,u,c,f;const n=qd(),r=(t==null?void 0:t.firstWeekContainsDate)??((u=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(c=n.locale)==null?void 0:c.options)==null?void 0:f.firstWeekContainsDate)??1,i=mF(e,t),o=Rn((t==null?void 0:t.in)||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),Bl(o,t)}function gF(e,t){const n=It(e,t==null?void 0:t.in),r=+Bl(n,t)-+bse(n,t);return Math.round(r/oF)+1}function Tt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ts={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Tt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Tt(n+1,2)},d(e,t){return Tt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Tt(e.getHours()%12||12,t.length)},H(e,t){return Tt(e.getHours(),t.length)},m(e,t){return Tt(e.getMinutes(),t.length)},s(e,t){return Tt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Tt(i,t.length)}},ol={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},DT={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return ts.y(e,t)},Y:function(e,t,n,r){const i=mF(e,r),o=i>0?i:1-i;if(t==="YY"){const s=o%100;return Tt(s,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Tt(o,t.length)},R:function(e,t){const n=lF(e);return Tt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Tt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Tt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Tt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return ts.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Tt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=gF(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},I:function(e,t,n){const r=pF(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Tt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ts.d(e,t)},D:function(e,t,n){const r=wse(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Tt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Tt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Tt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Tt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=ol.noon:r===0?i=ol.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=ol.evening:r>=12?i=ol.afternoon:r>=4?i=ol.morning:i=ol.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ts.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ts.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Tt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Tt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ts.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ts.s(e,t)},S:function(e,t){return ts.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return IT(r);case"XXXX":case"XX":return Gs(r);case"XXXXX":case"XXX":default:return Gs(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return IT(r);case"xxxx":case"xx":return Gs(r);case"xxxxx":case"xxx":default:return Gs(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+OT(r,":");case"OOOO":default:return"GMT"+Gs(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+OT(r,":");case"zzzz":default:return"GMT"+Gs(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return Tt(r,t.length)},T:function(e,t,n){return Tt(+e,t.length)}};function OT(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+Tt(o,2)}function IT(e,t){return e%60===0?(e>0?"-":"+")+Tt(Math.abs(e)/60,2):Gs(e,t)}function Gs(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Tt(Math.trunc(r/60),2),o=Tt(r%60,2);return n+i+t+o}const jT=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},yF=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},kse=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return jT(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",jT(r,t)).replace("{{time}}",yF(i,t))},Sse={p:yF,P:kse},Ese=/^D+$/,Cse=/^Y+$/,_se=["D","DD","YY","YYYY"];function Nse(e){return Ese.test(e)}function Tse(e){return Cse.test(e)}function Ase(e,t,n){const r=Pse(e,t,n);if(console.warn(r),_se.includes(e))throw new RangeError(r)}function Pse(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Rse=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Mse=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Dse=/^'([^]*?)'?$/,Ose=/''/g,Ise=/[a-zA-Z]/;function Pc(e,t,n){var f,h,p,m,y,x,k,w;const r=qd(),i=(n==null?void 0:n.locale)??r.locale??zm,o=(n==null?void 0:n.firstWeekContainsDate)??((h=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(p=r.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((x=(y=n==null?void 0:n.locale)==null?void 0:y.options)==null?void 0:x.weekStartsOn)??r.weekStartsOn??((w=(k=r.locale)==null?void 0:k.options)==null?void 0:w.weekStartsOn)??0,a=It(e,n==null?void 0:n.in);if(!dF(a))throw new RangeError("Invalid time value");let u=t.match(Mse).map(E=>{const C=E[0];if(C==="p"||C==="P"){const N=Sse[C];return N(E,i.formatLong)}return E}).join("").match(Rse).map(E=>{if(E==="''")return{isToken:!1,value:"'"};const C=E[0];if(C==="'")return{isToken:!1,value:jse(E)};if(DT[C])return{isToken:!0,value:E};if(C.match(Ise))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:E}});i.localize.preprocessor&&(u=i.localize.preprocessor(a,u));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return u.map(E=>{if(!E.isToken)return E.value;const C=E.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Tse(C)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Nse(C))&&Ase(C,t,String(e));const N=DT[C[0]];return N(a,C,i.localize,c)}).join("")}function jse(e){const t=e.match(Dse);return t?t[1].replace(Ose,"'"):e}function Lse(e,t){const n=It(e,t==null?void 0:t.in),r=n.getFullYear(),i=n.getMonth(),o=Rn(n,0);return o.setFullYear(r,i+1,0),o.setHours(0,0,0,0),o.getDate()}function Fse(e,t){return+It(e)>+It(t)}function zse(e,t){return+It(e)<+It(t)}function $se(e,t,n){const[r,i]=Gd(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function Bse(e,t,n){const[r,i]=Gd(n==null?void 0:n.in,e,t);return r.getFullYear()===i.getFullYear()}function Vse(e,t,n){const r=It(e,n==null?void 0:n.in),i=r.getFullYear(),o=r.getDate(),s=Rn(e,0);s.setFullYear(i,t,15),s.setHours(0,0,0,0);const a=Lse(s);return r.setMonth(t,Math.min(o,a)),r}function Wse(e,t,n){const r=It(e,n==null?void 0:n.in);return isNaN(+r)?Rn(e,NaN):(r.setFullYear(t),r)}function Use(e,t,n){var r=this,i=S.useRef(null),o=S.useRef(0),s=S.useRef(null),a=S.useRef([]),u=S.useRef(),c=S.useRef(),f=S.useRef(e),h=S.useRef(!0);f.current=e;var p=typeof window<"u",m=!t&&t!==0&&p;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var y=!!(n=n||{}).leading,x=!("trailing"in n)||!!n.trailing,k="maxWait"in n,w="debounceOnServer"in n&&!!n.debounceOnServer,E=k?Math.max(+n.maxWait||0,t):null;S.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var C=S.useMemo(function(){var N=function(R){var $=a.current,F=u.current;return a.current=u.current=null,o.current=R,c.current=f.current.apply(F,$)},P=function(R,$){m&&cancelAnimationFrame(s.current),s.current=m?requestAnimationFrame(R):setTimeout(R,$)},A=function(R){if(!h.current)return!1;var $=R-i.current;return!i.current||$>=t||$<0||k&&R-o.current>=E},O=function(R){return s.current=null,x&&a.current?N(R):(a.current=u.current=null,c.current)},M=function R(){var $=Date.now();if(A($))return O($);if(h.current){var F=t-($-i.current),H=k?Math.min(F,E-($-o.current)):F;P(R,H)}},j=function(){if(p||w){var R=Date.now(),$=A(R);if(a.current=[].slice.call(arguments),u.current=r,i.current=R,$){if(!s.current&&h.current)return o.current=i.current,P(M,t),y?N(i.current):c.current;if(k)return P(M,t),N(i.current)}return s.current||P(M,t),c.current}};return j.cancel=function(){s.current&&(m?cancelAnimationFrame(s.current):clearTimeout(s.current)),o.current=0,a.current=i.current=u.current=s.current=null},j.isPending=function(){return!!s.current},j.flush=function(){return s.current?O(Date.now()):c.current},j},[y,k,t,E,x,m,p,w]);return C}var Xe;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(Xe||(Xe={}));var Ot;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Ot||(Ot={}));var ai;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(ai||(ai={}));const LT=5,Hse=4;function Yse(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,i=t.addDays(e,-r+1),o=t.addDays(i,LT*7-1);return e.getMonth()===o.getMonth()?LT:Hse}function vF(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-1*6):t.addDays(n,-1*(r-1))}function qse(e,t){const n=vF(e,t),r=Yse(e,t);return t.addDays(n,r*7-1)}class Ao{constructor(t,n){this.Date=Date,this.addDays=(r,i)=>{var o;return(o=this.overrides)!=null&&o.addDays?this.overrides.addDays(r,i):sF(r,i)},this.addMonths=(r,i)=>{var o;return(o=this.overrides)!=null&&o.addMonths?this.overrides.addMonths(r,i):aF(r,i)},this.addWeeks=(r,i)=>{var o;return(o=this.overrides)!=null&&o.addWeeks?this.overrides.addWeeks(r,i):Moe(r,i)},this.addYears=(r,i)=>{var o;return(o=this.overrides)!=null&&o.addYears?this.overrides.addYears(r,i):Doe(r,i)},this.differenceInCalendarDays=(r,i)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,i):uF(r,i)},this.differenceInCalendarMonths=(r,i)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,i):Loe(r,i)},this.endOfBroadcastWeek=r=>{var i;return(i=this.overrides)!=null&&i.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r,this):qse(r,this)},this.endOfISOWeek=r=>{var i;return(i=this.overrides)!=null&&i.endOfISOWeek?this.overrides.endOfISOWeek(r):Boe(r)},this.endOfMonth=r=>{var i;return(i=this.overrides)!=null&&i.endOfMonth?this.overrides.endOfMonth(r):Foe(r)},this.endOfWeek=r=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(r,this.options):hF(r,this.options)},this.endOfYear=r=>{var i;return(i=this.overrides)!=null&&i.endOfYear?this.overrides.endOfYear(r):$oe(r)},this.format=(r,i)=>{var o;return(o=this.overrides)!=null&&o.format?this.overrides.format(r,i,this.options):Pc(r,i,this.options)},this.getISOWeek=r=>{var i;return(i=this.overrides)!=null&&i.getISOWeek?this.overrides.getISOWeek(r):pF(r)},this.getWeek=r=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(r,this.options):gF(r,this.options)},this.isAfter=(r,i)=>{var o;return(o=this.overrides)!=null&&o.isAfter?this.overrides.isAfter(r,i):Fse(r,i)},this.isBefore=(r,i)=>{var o;return(o=this.overrides)!=null&&o.isBefore?this.overrides.isBefore(r,i):zse(r,i)},this.isDate=r=>{var i;return(i=this.overrides)!=null&&i.isDate?this.overrides.isDate(r):cF(r)},this.isSameDay=(r,i)=>{var o;return(o=this.overrides)!=null&&o.isSameDay?this.overrides.isSameDay(r,i):joe(r,i)},this.isSameMonth=(r,i)=>{var o;return(o=this.overrides)!=null&&o.isSameMonth?this.overrides.isSameMonth(r,i):$se(r,i)},this.isSameYear=(r,i)=>{var o;return(o=this.overrides)!=null&&o.isSameYear?this.overrides.isSameYear(r,i):Bse(r,i)},this.max=r=>{var i;return(i=this.overrides)!=null&&i.max?this.overrides.max(r):Ooe(r)},this.min=r=>{var i;return(i=this.overrides)!=null&&i.min?this.overrides.min(r):Ioe(r)},this.setMonth=(r,i)=>{var o;return(o=this.overrides)!=null&&o.setMonth?this.overrides.setMonth(r,i):Vse(r,i)},this.setYear=(r,i)=>{var o;return(o=this.overrides)!=null&&o.setYear?this.overrides.setYear(r,i):Wse(r,i)},this.startOfBroadcastWeek=r=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):vF(r,this)},this.startOfDay=r=>{var i;return(i=this.overrides)!=null&&i.startOfDay?this.overrides.startOfDay(r):cd(r)},this.startOfISOWeek=r=>{var i;return(i=this.overrides)!=null&&i.startOfISOWeek?this.overrides.startOfISOWeek(r):ud(r)},this.startOfMonth=r=>{var i;return(i=this.overrides)!=null&&i.startOfMonth?this.overrides.startOfMonth(r):zoe(r)},this.startOfWeek=r=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(r,this.options):Bl(r,this.options)},this.startOfYear=r=>{var i;return(i=this.overrides)!=null&&i.startOfYear?this.overrides.startOfYear(r):fF(r)},this.options={locale:zm,...t},this.overrides=n}}const ka=new Ao;function Gse(e,t,n={}){return Object.entries(e).filter(([,i])=>i===!0).reduce((i,[o])=>(n[o]?i.push(n[o]):t[Ot[o]]?i.push(t[Ot[o]]):t[ai[o]]&&i.push(t[ai[o]]),i),[t[Xe.Day]])}function Zse(e){return ne.createElement("button",{...e})}function Kse(e){return ne.createElement("span",{...e})}function Xse(e){const{size:t=24,orientation:n="left",className:r}=e;return ne.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&ne.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&ne.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&ne.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&ne.createElement("polygon",{points:"8 18.612 14.1888889 12.5 8 6.37733333 9.91111111 4.5 18 12.5 9.91111111 20.5"}))}function Qse(e){const{day:t,modifiers:n,...r}=e;return ne.createElement("td",{...r})}function Jse(e){const{day:t,modifiers:n,...r}=e,i=ne.useRef(null);return ne.useEffect(()=>{var o;n.focused&&((o=i.current)==null||o.focus())},[n.focused]),ne.createElement("button",{ref:i,...r})}function eae(e){const{options:t,className:n,components:r,classNames:i,...o}=e,s=[i[Xe.Dropdown],n].join(" "),a=t==null?void 0:t.find(({value:u})=>u===o.value);return ne.createElement("span",{"data-disabled":o.disabled,className:i[Xe.DropdownRoot]},ne.createElement(r.Select,{className:s,...o},t==null?void 0:t.map(({value:u,label:c,disabled:f})=>ne.createElement(r.Option,{key:u,value:u,disabled:f},c))),ne.createElement("span",{className:i[Xe.CaptionLabel],"aria-hidden":!0},a==null?void 0:a.label,ne.createElement(r.Chevron,{orientation:"down",size:18,className:i[Xe.Chevron]})))}function tae(e){return ne.createElement("div",{...e})}function nae(e){return ne.createElement("div",{...e})}function rae(e){const{calendarMonth:t,displayIndex:n,...r}=e;return ne.createElement("div",{...r},e.children)}function iae(e){const{calendarMonth:t,displayIndex:n,...r}=e;return ne.createElement("div",{...r})}function oae(e){return ne.createElement("table",{...e})}function sae(e){return ne.createElement("div",{...e})}const xF=S.createContext(void 0);function Zd(){const e=S.useContext(xF);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function aae(e){const{components:t}=Zd();return ne.createElement(t.Dropdown,{...e})}function lae(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:i,...o}=e,{components:s,classNames:a,labels:{labelPrevious:u,labelNext:c}}=Zd();return ne.createElement("nav",{...o},ne.createElement(s.PreviousMonthButton,{type:"button",className:a[Xe.PreviousMonthButton],tabIndex:r?void 0:-1,disabled:r?void 0:!0,"aria-label":u(r),onClick:e.onPreviousClick},ne.createElement(s.Chevron,{disabled:r?void 0:!0,className:a[Xe.Chevron],orientation:"left"})),ne.createElement(s.NextMonthButton,{type:"button",className:a[Xe.NextMonthButton],tabIndex:i?void 0:-1,disabled:i?void 0:!0,"aria-label":c(i),onClick:e.onNextClick},ne.createElement(s.Chevron,{disabled:i?void 0:!0,orientation:"right",className:a[Xe.Chevron]})))}function uae(e){const{components:t}=Zd();return ne.createElement(t.Button,{...e})}function cae(e){return ne.createElement("option",{...e})}function dae(e){const{components:t}=Zd();return ne.createElement(t.Button,{...e})}function fae(e){return ne.createElement("div",{...e})}function hae(e){return ne.createElement("select",{...e})}function pae(e){const{week:t,...n}=e;return ne.createElement("tr",{...n})}function mae(e){return ne.createElement("th",{...e})}function gae(e){return ne.createElement("thead",{"aria-hidden":!0},ne.createElement("tr",{...e}))}function yae(e){const{week:t,...n}=e;return ne.createElement("th",{...n})}function vae(e){return ne.createElement("th",{...e})}function xae(e){return ne.createElement("tbody",{...e})}function wae(e){const{components:t}=Zd();return ne.createElement(t.Dropdown,{...e})}const bae=Object.freeze(Object.defineProperty({__proto__:null,Button:Zse,CaptionLabel:Kse,Chevron:Xse,Day:Qse,DayButton:Jse,Dropdown:eae,DropdownNav:tae,Footer:nae,Month:rae,MonthCaption:iae,MonthGrid:oae,Months:sae,MonthsDropdown:aae,Nav:lae,NextMonthButton:uae,Option:cae,PreviousMonthButton:dae,Root:fae,Select:hae,Week:pae,WeekNumber:yae,WeekNumberHeader:vae,Weekday:mae,Weekdays:gae,Weeks:xae,YearsDropdown:wae},Symbol.toStringTag,{value:"Module"}));function kae(e){return{...bae,...e}}function Sae(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function Eae(){const e={};for(const t in Xe)e[Xe[t]]=`rdp-${Xe[t]}`;for(const t in Ot)e[Ot[t]]=`rdp-${Ot[t]}`;for(const t in ai)e[ai[t]]=`rdp-${ai[t]}`;return e}function wF(e,t,n){return(n??new Ao(t)).format(e,"LLLL y")}const Cae=wF;function _ae(e,t,n){return(n??new Ao(t)).format(e,"d")}function Nae(e,t){var n;return(n=t.localize)==null?void 0:n.month(e)}function Tae(e){return e<10?`0${e.toLocaleString()}`:`${e.toLocaleString()}`}function Aae(){return""}function Pae(e,t,n){return(n??new Ao(t)).format(e,"cccccc")}function bF(e){return e.toString()}const Rae=bF,Mae=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:wF,formatDay:_ae,formatMonthCaption:Cae,formatMonthDropdown:Nae,formatWeekNumber:Tae,formatWeekNumberHeader:Aae,formatWeekdayName:Pae,formatYearCaption:Rae,formatYearDropdown:bF},Symbol.toStringTag,{value:"Module"}));function Dae(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...Mae,...e}}function Oae(e,t,n,r,i){if(!t||!n)return;const{addMonths:o,startOfMonth:s}=i,a=e.getFullYear(),u=[];let c=t;for(;u.length<12;)u.push(c.getMonth()),c=o(c,1);return u.sort((p,m)=>p-m).map(p=>{const m=r.formatMonthDropdown(p,i.options.locale??zm),y=i.Date?new i.Date(a,p):new Date(a,p),x=t&&y<s(t)||n&&y>s(n)||!1;return{value:p,label:m,disabled:x}})}function Iae(e,t={},n={}){let r={...t==null?void 0:t[Xe.Day]};return Object.entries(e).filter(([,i])=>i===!0).forEach(([i])=>{r={...r,...n==null?void 0:n[i]}}),r}const vx={},vc={};function Rc(e,t){try{const r=(vx[e]||(vx[e]=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return r in vc?vc[r]:FT(r,r.split(":"))}catch{if(e in vc)return vc[e];const n=e==null?void 0:e.match(jae);return n?FT(e,n.slice(1)):NaN}}const jae=/([+-]\d\d):?(\d\d)?/;function FT(e,t){const n=+t[0],r=+(t[1]||0);return vc[e]=n>0?n*60+r:n*60-r}class Ai extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Rc(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),kF(this),jw(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new Ai(...n,t):new Ai(Date.now(),t)}withTimeZone(t){return new Ai(+this,t)}getTimezoneOffset(){return-Rc(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),jw(this),+this}[Symbol.for("constructDateFrom")](t){return new Ai(+new Date(t),this.timeZone)}}const zT=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!zT.test(e))return;const t=e.replace(zT,"$1UTC");Ai.prototype[t]&&(e.startsWith("get")?Ai.prototype[e]=function(){return this.internal[t]()}:(Ai.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),Lae(this),+this},Ai.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),jw(this),+this}))});function jw(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function Lae(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),kF(e)}function kF(e){const t=Rc(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),i=-new Date(+n).getTimezoneOffset(),o=r-i,s=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&s&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const a=r-t;a&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+a);const u=Rc(e.timeZone,e),f=-new Date(+e).getTimezoneOffset()-u,h=u!==t,p=f-a;if(h&&p){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+p);const m=Rc(e.timeZone,e),y=u-m;y&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+y),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y))}}class Pi extends Ai{static tz(t,...n){return n.length?new Pi(...n,t):new Pi(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),i=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+i}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,i]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${i}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,i]=this.tzComponents();return`${t} GMT${n}${r}${i} (${Fae(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),i=String(Math.abs(t)%60).padStart(2,"0");return[n,r,i]}withTimeZone(t){return new Pi(+this,t)}[Symbol.for("constructDateFrom")](t){return new Pi(+new Date(t),this.timeZone)}}function Fae(e,t){return new Intl.DateTimeFormat("en-GB",{timeZone:e,timeZoneName:"long"}).format(t).slice(12)}function zae(e,t,n,r){const i=n?Pi.tz(n):e.Date?new e.Date:new Date,o=t?e.startOfISOWeek(i):e.startOfWeek(i),s=[];for(let a=0;a<7;a++){const u=e.addDays(o,a);s.push(u)}return s}function $ae(e,t,n,r){if(!e||!t)return;const{startOfYear:i,endOfYear:o,addYears:s,isBefore:a,isSameYear:u}=r,c=i(e),f=o(t),h=[];let p=c;for(;a(p,f)||u(p,f);)h.push(p.getFullYear()),p=s(p,1);return h.map(m=>{const y=n.formatYearDropdown(m);return{value:m,label:y,disabled:!1}})}function SF(e,t,n){return(n??new Ao(t)).format(e,"LLLL y")}const Bae=SF;function Vae(e,t,n,r){let i=(r??new Ao(n)).format(e,"PPPP");return t!=null&&t.today&&(i=`Today, ${i}`),i}function EF(e,t,n,r){let i=(r??new Ao(n)).format(e,"PPPP");return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i}const Wae=EF;function Uae(){return""}function Hae(e){return"Choose the Month"}function Yae(e){return"Go to the Next Month"}function qae(e){return"Go to the Previous Month"}function Gae(e,t,n){return(n??new Ao(t)).format(e,"cccc")}function Zae(e,t){return`Week ${e}`}function Kae(e){return"Week Number"}function Xae(e){return"Choose the Year"}const Qae=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:Bae,labelDay:Wae,labelDayButton:EF,labelGrid:SF,labelGridcell:Vae,labelMonthDropdown:Hae,labelNav:Uae,labelNext:Yae,labelPrevious:qae,labelWeekNumber:Zae,labelWeekNumberHeader:Kae,labelWeekday:Gae,labelYearDropdown:Xae},Symbol.toStringTag,{value:"Module"}));function Jae(e,t,n,r){const i=e[0],o=e[e.length-1],{ISOWeek:s,fixedWeeks:a,broadcastCalendar:u}=n??{},{addDays:c,differenceInCalendarDays:f,differenceInCalendarMonths:h,endOfBroadcastWeek:p,endOfISOWeek:m,endOfMonth:y,endOfWeek:x,isAfter:k,startOfBroadcastWeek:w,startOfISOWeek:E,startOfWeek:C}=r,N=u?w(i,r):s?E(i):C(i),P=u?p(o,r):s?m(y(o)):x(y(o)),A=f(P,N),O=h(o,i)+1,M=[];for(let $=0;$<=A;$++){const F=c(N,$);if(t&&k(F,t))break;M.push(F)}const R=(u?35:42)*O;if(a&&M.length<R){const $=R-M.length;for(let F=0;F<$;F++){const H=c(M[M.length-1],1);M.push(H)}}return M}function ele(e){const t=[];return e.reduce((n,r)=>{const i=[],o=r.weeks.reduce((s,a)=>[...s,...a.days],i);return[...n,...o]},t)}function tle(e,t,n,r){const{numberOfMonths:i=1}=n,o=[];for(let s=0;s<i;s++){const a=r.addMonths(e,s);if(t&&a>t)break;o.push(a)}return o}function $T(e,t){const{month:n,defaultMonth:r,today:i=e.timeZone?Pi.tz(e.timeZone):t.Date?new t.Date:new Date,numberOfMonths:o=1,endMonth:s,startMonth:a}=e;let u=n||r||i;const{differenceInCalendarMonths:c,addMonths:f,startOfMonth:h}=t;if(s&&c(s,u)<0){const p=-1*(o-1);u=f(s,p)}return a&&c(u,a)<0&&(u=a),h(u)}class CF{constructor(t,n,r=ka){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class nle{constructor(t,n){this.date=t,this.weeks=n}}class rle{constructor(t,n){this.days=n,this.weekNumber=t}}function ile(e,t,n,r){const{addDays:i,endOfBroadcastWeek:o,endOfISOWeek:s,endOfMonth:a,endOfWeek:u,getISOWeek:c,getWeek:f,startOfBroadcastWeek:h,startOfISOWeek:p,startOfWeek:m}=r,y=e.reduce((x,k)=>{const w=n.broadcastCalendar?h(k,r):n.ISOWeek?p(k):m(k),E=n.broadcastCalendar?o(k,r):n.ISOWeek?s(a(k)):u(a(k)),C=t.filter(O=>O>=w&&O<=E),N=n.broadcastCalendar?35:42;if(n.fixedWeeks&&C.length<N){const O=t.filter(M=>{const j=N-C.length;return M>E&&M<=i(E,j)});C.push(...O)}const P=C.reduce((O,M)=>{const j=n.ISOWeek?c(M):f(M),R=O.find(F=>F.weekNumber===j),$=new CF(M,k,r);return R?R.days.push($):O.push(new rle(j,[$])),O},[]),A=new nle(k,P);return x.push(A),x},[]);return n.reverseMonths?y.reverse():y}function ole(e,t){var x;let{startMonth:n,endMonth:r}=e;const{startOfYear:i,startOfDay:o,startOfMonth:s,endOfMonth:a,addYears:u,endOfYear:c}=t,{fromYear:f,toYear:h,fromMonth:p,toMonth:m}=e;!n&&p&&(n=p),!n&&f&&(n=new Date(f,0,1)),!r&&m&&(r=m),!r&&h&&(r=new Date(h,11,31));const y=(x=e.captionLayout)==null?void 0:x.startsWith("dropdown");if(n)n=s(n);else if(f)n=new Date(f,0,1);else if(!n&&y){const k=e.today??(e.timeZone?Pi.tz(e.timeZone):t.Date?new t.Date:new Date);n=i(u(k,-100))}if(r)r=a(r);else if(h)r=new Date(h,11,31);else if(!r&&y){const k=e.today??(e.timeZone?Pi.tz(e.timeZone):t.Date?new t.Date:new Date);r=c(k)}return[n&&o(n),r&&o(r)]}function sle(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:i,numberOfMonths:o=1}=n,{startOfMonth:s,addMonths:a,differenceInCalendarMonths:u}=r,c=i?o:1,f=s(e);if(!t)return a(f,c);if(!(u(t,e)<o))return a(f,c)}function ale(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:i,numberOfMonths:o}=n,{startOfMonth:s,addMonths:a,differenceInCalendarMonths:u}=r,c=i?o??1:1,f=s(e);if(!t)return a(f,-c);if(!(u(f,t)<=0))return a(f,-c)}function lle(e){const t=[];return e.reduce((n,r)=>[...n,...r.weeks],t)}function $m(e,t){const[n,r]=S.useState(e);return[t===void 0?n:t,r]}function ule(e,t){const[n,r]=ole(e,t),{startOfMonth:i,endOfMonth:o}=t,s=$T(e,t),[a,u]=$m(s,e.month?i(e.month):void 0);S.useEffect(()=>{const A=$T(e,t);u(A)},[e.timeZone]);const c=tle(a,r,e,t),f=Jae(c,e.endMonth?o(e.endMonth):void 0,e,t),h=ile(c,f,e,t),p=lle(h),m=ele(h),y=ale(a,n,e,t),x=sle(a,r,e,t),{disableNavigation:k,onMonthChange:w}=e,E=A=>p.some(O=>O.days.some(M=>M.isEqualTo(A))),C=A=>{if(k)return;let O=i(A);n&&O<i(n)&&(O=i(n)),r&&O>i(r)&&(O=i(r)),u(O),w==null||w(O)};return{months:h,weeks:p,days:m,navStart:n,navEnd:r,previousMonth:y,nextMonth:x,goToMonth:C,goToDay:A=>{E(A)||C(A.date)}}}function cle(e,t,n,r){let i,o=0,s=!1;for(;o<e.length&&!s;){const a=e[o],u=t(a);!u[Ot.disabled]&&!u[Ot.hidden]&&!u[Ot.outside]&&(u[Ot.focused]||r!=null&&r.isEqualTo(a)||n(a.date)||u[Ot.today])&&(i=a,s=!0),o++}return i||(i=e.find(a=>{const u=t(a);return!u[Ot.disabled]&&!u[Ot.hidden]&&!u[Ot.outside]})),i}function co(e,t,n=!1,r=ka){let{from:i,to:o}=e;const{differenceInCalendarDays:s,isSameDay:a}=r;return i&&o?(s(o,i)<0&&([i,o]=[o,i]),s(t,i)>=(n?1:0)&&s(o,t)>=(n?1:0)):!n&&o?a(o,t):!n&&i?a(i,t):!1}function _F(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function gk(e){return!!(e&&typeof e=="object"&&"from"in e)}function NF(e){return!!(e&&typeof e=="object"&&"after"in e)}function TF(e){return!!(e&&typeof e=="object"&&"before"in e)}function AF(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function PF(e,t){return Array.isArray(e)&&e.every(t.isDate)}function fo(e,t,n=ka){const r=Array.isArray(t)?t:[t],{isSameDay:i,differenceInCalendarDays:o,isAfter:s}=n;return r.some(a=>{if(typeof a=="boolean")return a;if(n.isDate(a))return i(e,a);if(PF(a,n))return a.includes(e);if(gk(a))return co(a,e,!1,n);if(AF(a))return Array.isArray(a.dayOfWeek)?a.dayOfWeek.includes(e.getDay()):a.dayOfWeek===e.getDay();if(_F(a)){const u=o(a.before,e),c=o(a.after,e),f=u>0,h=c<0;return s(a.before,a.after)?h&&f:f||h}return NF(a)?o(e,a.after)>0:TF(a)?o(a.before,e)>0:typeof a=="function"?a(e):!1})}function dle(e,t,n,r,i,o,s){const{ISOWeek:a,broadcastCalendar:u}=o,{addDays:c,addMonths:f,addWeeks:h,addYears:p,endOfBroadcastWeek:m,endOfISOWeek:y,endOfWeek:x,max:k,min:w,startOfBroadcastWeek:E,startOfISOWeek:C,startOfWeek:N}=s;let A={day:c,week:h,month:f,year:p,startOfWeek:O=>u?E(O,s):a?C(O):N(O),endOfWeek:O=>u?m(O,s):a?y(O):x(O)}[e](n,t==="after"?1:-1);return t==="before"&&r?A=k([r,A]):t==="after"&&i&&(A=w([i,A])),A}function RF(e,t,n,r,i,o,s,a=0){if(a>365)return;const u=dle(e,t,n.date,r,i,o,s),c=!!(o.disabled&&fo(u,o.disabled,s)),f=!!(o.hidden&&fo(u,o.hidden,s)),h=u,p=new CF(u,h,s);return!c&&!f?p:RF(e,t,p,r,i,o,s,a+1)}function fle(e,t,n,r,i){const{autoFocus:o}=e,[s,a]=S.useState(),u=cle(t.days,n,r||(()=>!1),s),[c,f]=S.useState(o?u:void 0);return{isFocusTarget:x=>!!(u!=null&&u.isEqualTo(x)),setFocused:f,focused:c,blur:()=>{a(c),f(void 0)},moveFocus:(x,k)=>{if(!c)return;const w=RF(x,k,c,t.navStart,t.navEnd,e,i);w&&(t.goToDay(w),f(w))}}}function hle(e,t,n){const{disabled:r,hidden:i,modifiers:o,showOutsideDays:s,broadcastCalendar:a,today:u}=t,{isSameDay:c,isSameMonth:f,startOfMonth:h,isBefore:p,endOfMonth:m,isAfter:y}=n,x=t.startMonth&&h(t.startMonth),k=t.endMonth&&m(t.endMonth),w={[Ot.focused]:[],[Ot.outside]:[],[Ot.disabled]:[],[Ot.hidden]:[],[Ot.today]:[]},E={};for(const C of e){const{date:N,displayMonth:P}=C,A=!!(P&&!f(N,P)),O=!!(x&&p(N,x)),M=!!(k&&y(N,k)),j=!!(r&&fo(N,r,n)),R=!!(i&&fo(N,i,n))||O||M||!a&&!s&&A||a&&s===!1&&A,$=c(N,u??(t.timeZone?Pi.tz(t.timeZone):n.Date?new n.Date:new Date));A&&w.outside.push(C),j&&w.disabled.push(C),R&&w.hidden.push(C),$&&w.today.push(C),o&&Object.keys(o).forEach(F=>{const H=o==null?void 0:o[F];H&&fo(N,H,n)&&(E[F]?E[F].push(C):E[F]=[C])})}return C=>{const N={[Ot.focused]:!1,[Ot.disabled]:!1,[Ot.hidden]:!1,[Ot.outside]:!1,[Ot.today]:!1},P={};for(const A in w){const O=w[A];N[A]=O.some(M=>M===C)}for(const A in E)P[A]=E[A].some(O=>O===C);return{...N,...P}}}function ple(e,t){const{selected:n,required:r,onSelect:i}=e,[o,s]=$m(n,i?n:void 0),a=i?n:o,{isSameDay:u}=t,c=m=>(a==null?void 0:a.some(y=>u(y,m)))??!1,{min:f,max:h}=e;return{selected:a,select:(m,y,x)=>{let k=[...a??[]];if(c(m)){if((a==null?void 0:a.length)===f||r&&(a==null?void 0:a.length)===1)return;k=a==null?void 0:a.filter(w=>!u(w,m))}else(a==null?void 0:a.length)===h?k=[m]:k=[...k,m];return i||s(k),i==null||i(k,m,y,x),k},isSelected:c}}function mle(e,t,n=0,r=0,i=!1,o=ka){const{from:s,to:a}=t||{},{isSameDay:u,isAfter:c,isBefore:f}=o;let h;if(!s&&!a)h={from:e,to:n>0?void 0:e};else if(s&&!a)u(s,e)?i?h={from:s,to:void 0}:h=void 0:f(e,s)?h={from:e,to:s}:h={from:s,to:e};else if(s&&a)if(u(s,e)&&u(a,e))i?h={from:s,to:a}:h=void 0;else if(u(s,e))h={from:s,to:n>0?void 0:e};else if(u(a,e))h={from:e,to:n>0?void 0:e};else if(f(e,s))h={from:e,to:a};else if(c(e,s))h={from:s,to:e};else if(c(e,a))h={from:s,to:e};else throw new Error("Invalid range");if(h!=null&&h.from&&(h!=null&&h.to)){const p=o.differenceInCalendarDays(h.to,h.from);r>0&&p>r?h={from:e,to:void 0}:n>1&&p<n&&(h={from:e,to:void 0})}return h}function gle(e,t,n=ka){const r=Array.isArray(t)?t:[t];let i=e.from;const o=n.differenceInCalendarDays(e.to,e.from),s=Math.min(o,6);for(let a=0;a<=s;a++){if(r.includes(i.getDay()))return!0;i=n.addDays(i,1)}return!1}function BT(e,t,n=ka){return co(e,t.from,!1,n)||co(e,t.to,!1,n)||co(t,e.from,!1,n)||co(t,e.to,!1,n)}function yle(e,t,n=ka){const r=Array.isArray(t)?t:[t];if(r.filter(a=>typeof a!="function").some(a=>typeof a=="boolean"?a:n.isDate(a)?co(e,a,!1,n):PF(a,n)?a.some(u=>co(e,u,!1,n)):gk(a)?a.from&&a.to?BT(e,{from:a.from,to:a.to},n):!1:AF(a)?gle(e,a.dayOfWeek,n):_F(a)?n.isAfter(a.before,a.after)?BT(e,{from:n.addDays(a.after,1),to:n.addDays(a.before,-1)},n):fo(e.from,a,n)||fo(e.to,a,n):NF(a)||TF(a)?fo(e.from,a,n)||fo(e.to,a,n):!1))return!0;const s=r.filter(a=>typeof a=="function");if(s.length){let a=e.from;const u=n.differenceInCalendarDays(e.to,e.from);for(let c=0;c<=u;c++){if(s.some(f=>f(a)))return!0;a=n.addDays(a,1)}}return!1}function vle(e,t){const{disabled:n,excludeDisabled:r,selected:i,required:o,onSelect:s}=e,[a,u]=$m(i,s?i:void 0),c=s?i:a;return{selected:c,select:(p,m,y)=>{const{min:x,max:k}=e,w=p?mle(p,c,x,k,o,t):void 0;return r&&n&&(w!=null&&w.from)&&w.to&&yle({from:w.from,to:w.to},n,t)&&(w.from=p,w.to=void 0),s||u(w),s==null||s(w,p,m,y),w},isSelected:p=>c&&co(c,p,!1,t)}}function xle(e,t){const{selected:n,required:r,onSelect:i}=e,[o,s]=$m(n,i?n:void 0),a=i?n:o,{isSameDay:u}=t;return{selected:a,select:(h,p,m)=>{let y=h;return!r&&a&&a&&u(h,a)&&(y=void 0),i||s(y),i==null||i(y,h,p,m),y},isSelected:h=>a?u(a,h):!1}}function wle(e,t){const n=xle(e,t),r=ple(e,t),i=vle(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return i;default:return}}function ble(e){const{components:t,formatters:n,labels:r,dateLib:i,locale:o,classNames:s}=S.useMemo(()=>{const He={...zm,...e.locale};return{dateLib:new Ao({locale:He,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens},e.dateLib),components:kae(e.components),formatters:Dae(e.formatters),labels:{...Qae,...e.labels},locale:He,classNames:{...Eae(),...e.classNames}}},[e.classNames,e.components,e.dateLib,e.firstWeekContainsDate,e.formatters,e.labels,e.locale,e.useAdditionalDayOfYearTokens,e.useAdditionalWeekYearTokens,e.weekStartsOn,e.broadcastCalendar]),{captionLayout:a,mode:u,onDayBlur:c,onDayClick:f,onDayFocus:h,onDayKeyDown:p,onDayMouseEnter:m,onDayMouseLeave:y,onNextClick:x,onPrevClick:k,showWeekNumber:w,styles:E}=e,{formatCaption:C,formatDay:N,formatMonthDropdown:P,formatWeekNumber:A,formatWeekNumberHeader:O,formatWeekdayName:M,formatYearDropdown:j}=n,R=ule(e,i),{days:$,months:F,navStart:H,navEnd:I,previousMonth:Y,nextMonth:q,goToMonth:Z}=R,B=hle($,e,i),{isSelected:W,select:L,selected:U}=wle(e,i)??{},{blur:V,focused:D,isFocusTarget:G,moveFocus:K,setFocused:J}=fle(e,R,B,W??(()=>!1),i),{labelDayButton:ee,labelGridcell:re,labelGrid:ue,labelMonthDropdown:he,labelNav:be,labelWeekday:fe,labelWeekNumber:ve,labelWeekNumberHeader:Me,labelYearDropdown:$e}=r,ct=S.useMemo(()=>zae(i,e.ISOWeek,e.timeZone),[i,e.ISOWeek,e.timeZone]),_t=u!==void 0||f!==void 0,Q=S.useCallback(()=>{Y&&(Z(Y),k==null||k(Y))},[Y,Z,k]),oe=S.useCallback(()=>{q&&(Z(q),x==null||x(q))},[Z,q,x]),ae=S.useCallback((He,it)=>at=>{at.preventDefault(),at.stopPropagation(),J(He),L==null||L(He.date,it,at),f==null||f(He.date,it,at)},[L,f,J]),Ce=S.useCallback((He,it)=>at=>{J(He),h==null||h(He.date,it,at)},[h,J]),ke=S.useCallback((He,it)=>at=>{V(),c==null||c(He.date,it,at)},[V,c]),ge=S.useCallback((He,it)=>at=>{const Wt={ArrowLeft:["day",e.dir==="rtl"?"after":"before"],ArrowRight:["day",e.dir==="rtl"?"before":"after"],ArrowDown:["week","after"],ArrowUp:["week","before"],PageUp:[at.shiftKey?"year":"month","before"],PageDown:[at.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Wt[at.key]){at.preventDefault(),at.stopPropagation();const[yt,yn]=Wt[at.key];K(yt,yn)}p==null||p(He.date,it,at)},[K,p,e.dir]),Ae=S.useCallback((He,it)=>at=>{m==null||m(He.date,it,at)},[m]),Fe=S.useCallback((He,it)=>at=>{y==null||y(He.date,it,at)},[y]),ce=S.useCallback(He=>it=>{const at=Number(it.target.value),Wt=i.setMonth(i.startOfMonth(He),at);Z(Wt)},[i,Z]),pe=S.useCallback(He=>it=>{const at=Number(it.target.value),Wt=i.setYear(i.startOfMonth(He),at);Z(Wt)},[i,Z]),{className:Ie,style:Ke}=S.useMemo(()=>({className:[s[Xe.Root],e.className].filter(Boolean).join(" "),style:{...E==null?void 0:E[Xe.Root],...e.style}}),[s,e.className,e.style,E]),tt=Sae(e),At={dayPickerProps:e,selected:U,select:L,isSelected:W,months:F,nextMonth:q,previousMonth:Y,goToMonth:Z,getModifiers:B,components:t,classNames:s,styles:E,labels:r,formatters:n};return ne.createElement(xF.Provider,{value:At},ne.createElement(t.Root,{className:Ie,style:Ke,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],...tt},ne.createElement(t.Months,{className:s[Xe.Months],style:E==null?void 0:E[Xe.Months]},!e.hideNavigation&&ne.createElement(t.Nav,{className:s[Xe.Nav],style:E==null?void 0:E[Xe.Nav],"aria-label":be(),onPreviousClick:Q,onNextClick:oe,previousMonth:Y,nextMonth:q}),F.map((He,it)=>{const at=Oae(He.date,H,I,n,i),Wt=$ae(H,I,n,i);return ne.createElement(t.Month,{className:s[Xe.Month],style:E==null?void 0:E[Xe.Month],key:it,displayIndex:it,calendarMonth:He},ne.createElement(t.MonthCaption,{className:s[Xe.MonthCaption],style:E==null?void 0:E[Xe.MonthCaption],calendarMonth:He,displayIndex:it},a!=null&&a.startsWith("dropdown")?ne.createElement(t.DropdownNav,{className:s[Xe.Dropdowns],style:E==null?void 0:E[Xe.Dropdowns]},a==="dropdown"||a==="dropdown-months"?ne.createElement(t.MonthsDropdown,{className:s[Xe.MonthsDropdown],"aria-label":he(),classNames:s,components:t,disabled:!!e.disableNavigation,onChange:ce(He.date),options:at,style:E==null?void 0:E[Xe.Dropdown],value:He.date.getMonth()}):ne.createElement("span",{role:"status","aria-live":"polite"},P(He.date.getMonth(),o)),a==="dropdown"||a==="dropdown-years"?ne.createElement(t.YearsDropdown,{className:s[Xe.YearsDropdown],"aria-label":$e(i.options),classNames:s,components:t,disabled:!!e.disableNavigation,onChange:pe(He.date),options:Wt,style:E==null?void 0:E[Xe.Dropdown],value:He.date.getFullYear()}):ne.createElement("span",{role:"status","aria-live":"polite"},j(He.date.getFullYear()))):ne.createElement(t.CaptionLabel,{className:s[Xe.CaptionLabel],role:"status","aria-live":"polite"},C(He.date,i.options,i))),ne.createElement(t.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":ue(He.date,i.options,i)||void 0,className:s[Xe.MonthGrid],style:E==null?void 0:E[Xe.MonthGrid]},!e.hideWeekdays&&ne.createElement(t.Weekdays,{className:s[Xe.Weekdays],style:E==null?void 0:E[Xe.Weekdays]},w&&ne.createElement(t.WeekNumberHeader,{"aria-label":Me(i.options),className:s[Xe.WeekNumberHeader],style:E==null?void 0:E[Xe.WeekNumberHeader],scope:"col"},O()),ct.map((yt,yn)=>ne.createElement(t.Weekday,{"aria-label":fe(yt,i.options,i),className:s[Xe.Weekday],key:yn,style:E==null?void 0:E[Xe.Weekday],scope:"col"},M(yt,i.options,i)))),ne.createElement(t.Weeks,{className:s[Xe.Weeks],style:E==null?void 0:E[Xe.Weeks]},He.weeks.map((yt,yn)=>ne.createElement(t.Week,{className:s[Xe.Week],key:yt.weekNumber,style:E==null?void 0:E[Xe.Week],week:yt},w&&ne.createElement(t.WeekNumber,{week:yt,style:E==null?void 0:E[Xe.WeekNumber],"aria-label":ve(yt.weekNumber,{locale:o}),className:s[Xe.WeekNumber],scope:"row",role:"rowheader"},A(yt.weekNumber)),yt.days.map(gt=>{const{date:jt}=gt,ft=B(gt);if(ft[Ot.focused]=!ft.hidden&&!!(D!=null&&D.isEqualTo(gt)),ft[ai.selected]=!ft.disabled&&((W==null?void 0:W(jt))||ft.selected),gk(U)){const{from:rn,to:vn}=U;ft[ai.range_start]=!!(rn&&vn&&i.isSameDay(jt,rn)),ft[ai.range_end]=!!(rn&&vn&&i.isSameDay(jt,vn)),ft[ai.range_middle]=co(U,jt,!0,i)}const Ye=Iae(ft,E,e.modifiersStyles),dt=Gse(ft,s,e.modifiersClassNames),Ct=!_t&&!ft.hidden?re(jt,ft,i.options,i):void 0;return ne.createElement(t.Day,{key:`${i.format(jt,"yyyy-MM-dd")}_${i.format(gt.displayMonth,"yyyy-MM")}`,day:gt,modifiers:ft,className:dt.join(" "),style:Ye,role:"gridcell","aria-selected":ft.selected||void 0,"aria-label":Ct,"data-day":i.format(jt,"yyyy-MM-dd"),"data-month":gt.outside?i.format(jt,"yyyy-MM"):void 0,"data-selected":ft.selected||void 0,"data-disabled":ft.disabled||void 0,"data-hidden":ft.hidden||void 0,"data-outside":gt.outside||void 0,"data-focused":ft.focused||void 0,"data-today":ft.today||void 0},!ft.hidden&&_t?ne.createElement(t.DayButton,{className:s[Xe.DayButton],style:E==null?void 0:E[Xe.DayButton],type:"button",day:gt,modifiers:ft,disabled:ft.disabled||void 0,tabIndex:G(gt)?0:-1,"aria-label":ee(jt,ft,i.options,i),onClick:ae(gt,ft),onBlur:ke(gt,ft),onFocus:Ce(gt,ft),onKeyDown:ge(gt,ft),onMouseEnter:Ae(gt,ft),onMouseLeave:Fe(gt,ft)},N(jt,i.options,i)):!ft.hidden&&N(gt.date,i.options,i))}))))))})),e.footer&&ne.createElement(t.Footer,{className:s[Xe.Footer],style:E==null?void 0:E[Xe.Footer],role:"status","aria-live":"polite"},e.footer)))}function MF({className:e,classNames:t,showOutsideDays:n=!0,...r}){return v.jsx(ble,{showOutsideDays:n,className:Te("p-3",e),classNames:{months:"flex flex-col space-y-4 sm:space-y-0",month:"space-y-4",month_caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm text-text font-medium",nav:"space-x-1 flex items-center",button_previous:Te(xl({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100","absolute left-1 top-[12px] z-10"),button_next:Te(xl({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100","absolute right-1 top-[12px] z-10"),month_grid:"w-full border-collapse space-y-1",weekdays:"flex",weekday:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",week:"flex w-full mt-2",day:Te(xl({variant:"ghost"}),"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md","h-8 w-8 p-0 hover:bg-lightGray-7/50 font-normal aria-selected:opacity-100"),range_start:"day-range-start",range_end:"day-range-end",selected:"!bg-primary !text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",today:"bg-lightGray-7/50 text-accent-foreground",outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",disabled:"text-muted-foreground opacity-50",range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",hidden:"invisible",...t},components:{Chevron:({orientation:i})=>v.jsx(uR,{className:Te("h-4 w-4",{"rotate-180":i==="up","rotate-90":i==="left","-rotate-90":i==="right"})})},...r})}MF.displayName="Calendar";const kle=nu("flex w-full text-mastra-el-6 rounded-sm border bg-transparent shadow-sm focus-visible:ring-ring transition-colors focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border-mastra-border-1 border-border-1 placeholder:text-muted-foreground",filled:"bg-inputFill border-border-1 placeholder:text-muted-foreground",unstyled:"border-0 bg-transparent placeholder:text-muted-foreground focus-visible:ring-transparent focus-visible:outline-none"},customSize:{default:"px-[13px] text-[calc(13_/_16_*_1rem)] h-[34px]",sm:"h-[30px] px-[13px] text-xs",lg:"h-10 px-[17px] rounded-md text-[calc(13_/_16_*_1rem)]"}},defaultVariants:{variant:"default",customSize:"default"}}),Kd=S.forwardRef(({className:e,customSize:t,testId:n,variant:r,type:i,...o},s)=>v.jsx("input",{type:i,className:Te(e,kle({variant:r,customSize:t,className:e})),"data-testid":n,ref:s,...o}));Kd.displayName="Input";const Sle=({value:e,setValue:t,children:n,className:r,placeholder:i,...o})=>{const[s,a]=S.useState(!1);return v.jsxs(rF,{open:s,onOpenChange:a,children:[v.jsx(iF,{asChild:!0,children:n||v.jsx(DF,{value:e,placeholder:i,className:r,"data-testid":"datepicker-button"})}),v.jsx(mk,{className:"backdrop-blur-4xl w-auto p-0",align:"start","data-testid":"datepicker-calendar",children:v.jsx(Ele,{value:e,setValue:u=>t(u?new Date(`${u}z`):null),clearable:o.clearable,setOpenPopover:a,...o})})]})},Ele=({value:e,setValue:t,setOpenPopover:n,clearable:r,placeholder:i,className:o,...s})=>{const[a,u]=S.useState(e?Pc(e,"PP"):""),[c,f]=S.useState(e?new Date(e):void 0),h=Use(x=>{dF(x)&&(f(x),t==null||t(x),n==null||n(!1))},2e3),p=x=>{u(x.currentTarget.value);const k=new Date(x.target.value);h(k)},m=x=>{f(x),t==null||t(x),n==null||n(!1),u(x?Pc(x,"PP"):"")},y=x=>{f(x),u(x?Pc(x,"PP"):"")};return v.jsxs("div",{"aria-label":"Choose date",className:"relative mt-2 flex flex-col gap-2",onKeyDown:x=>{x.stopPropagation(),x.key==="Escape"&&(n==null||n(!1))},children:[v.jsx("div",{className:"w-full px-3",children:v.jsx(Kd,{type:"date",value:a,onChange:p,placeholder:i,className:o})}),v.jsx(MF,{mode:"single",month:c,selected:c,onMonthChange:y,onSelect:m,...s}),v.jsx("div",{className:"px-3 pb-2",children:r&&v.jsx(Bt,{variant:"outline",tabIndex:0,className:"w-full !opacity-50 duration-200 hover:!opacity-100",onClick:()=>{t(null),f(void 0),u(""),n==null||n(!1)},children:"Clear"})})]})},DF=S.forwardRef(({value:e,placeholder:t,className:n,...r},i)=>v.jsxs(Bt,{ref:i,variant:"outline",className:Te("bg-neutral-825 border-neutral-775 w-full justify-start whitespace-nowrap rounded-md border px-2 py-0 text-left flex items-center gap-1",n),...r,children:[v.jsx(uR,{className:"h-4 w-4"}),e?v.jsx("span",{className:"text-white",children:Pc(e,"PPP")}):v.jsx("span",{className:"text-gray",children:t??"Pick a date"})]}));DF.displayName="DefaultButton";function Cle({name:e,control:t,handleFieldChange:n}){return v.jsx(uu,{name:e,control:t,render:({field:r})=>v.jsx(Sle,{value:r.value,setValue:i=>{r.onChange(i),n==null||n({key:e,value:i})}})})}var _le="VisuallyHidden",OF=S.forwardRef((e,t)=>v.jsx(Ue.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));OF.displayName=_le;var Nle=[" ","Enter","ArrowUp","ArrowDown"],Tle=[" ","Enter"],Xd="Select",[Bm,Vm,Ale]=_1(Xd),[cu,Nve]=Yr(Xd,[Ale,lu]),Wm=lu(),[Ple,Ns]=cu(Xd),[Rle,Mle]=cu(Xd),IF=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:u,dir:c,name:f,autoComplete:h,disabled:p,required:m,form:y}=e,x=Wm(t),[k,w]=S.useState(null),[E,C]=S.useState(null),[N,P]=S.useState(!1),A=Cd(c),[O=!1,M]=wo({prop:r,defaultProp:i,onChange:o}),[j,R]=wo({prop:s,defaultProp:a,onChange:u}),$=S.useRef(null),F=k?y||!!k.closest("form"):!0,[H,I]=S.useState(new Set),Y=Array.from(H).map(q=>q.props.value).join(";");return v.jsx(Rm,{...x,children:v.jsxs(Ple,{required:m,scope:t,trigger:k,onTriggerChange:w,valueNode:E,onValueNodeChange:C,valueNodeHasChildren:N,onValueNodeHasChildrenChange:P,contentId:En(),value:j,onValueChange:R,open:O,onOpenChange:M,dir:A,triggerPointerDownPosRef:$,disabled:p,children:[v.jsx(Bm.Provider,{scope:t,children:v.jsx(Rle,{scope:e.__scopeSelect,onNativeOptionAdd:S.useCallback(q=>{I(Z=>new Set(Z).add(q))},[]),onNativeOptionRemove:S.useCallback(q=>{I(Z=>{const B=new Set(Z);return B.delete(q),B})},[]),children:n})}),F?v.jsxs(n4,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:h,value:j,onChange:q=>R(q.target.value),disabled:p,form:y,children:[j===void 0?v.jsx("option",{value:""}):null,Array.from(H)]},Y):null]})})};IF.displayName=Xd;var jF="SelectTrigger",LF=S.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Wm(n),s=Ns(jF,n),a=s.disabled||r,u=pt(t,s.onTriggerChange),c=Vm(n),f=S.useRef("touch"),[h,p,m]=r4(x=>{const k=c().filter(C=>!C.disabled),w=k.find(C=>C.value===s.value),E=i4(k,x,w);E!==void 0&&s.onValueChange(E.value)}),y=x=>{a||(s.onOpenChange(!0),m()),x&&(s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return v.jsx(Mm,{asChild:!0,...o,children:v.jsx(Ue.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":t4(s.value)?"":void 0,...i,ref:u,onClick:Re(i.onClick,x=>{x.currentTarget.focus(),f.current!=="mouse"&&y(x)}),onPointerDown:Re(i.onPointerDown,x=>{f.current=x.pointerType;const k=x.target;k.hasPointerCapture(x.pointerId)&&k.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(y(x),x.preventDefault())}),onKeyDown:Re(i.onKeyDown,x=>{const k=h.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&p(x.key),!(k&&x.key===" ")&&Nle.includes(x.key)&&(y(),x.preventDefault())})})})});LF.displayName=jF;var FF="SelectValue",zF=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,u=Ns(FF,n),{onValueNodeHasChildrenChange:c}=u,f=o!==void 0,h=pt(t,u.onValueNodeChange);return Un(()=>{c(f)},[c,f]),v.jsx(Ue.span,{...a,ref:h,style:{pointerEvents:"none"},children:t4(u.value)?v.jsx(v.Fragment,{children:s}):o})});zF.displayName=FF;var Dle="SelectIcon",$F=S.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return v.jsx(Ue.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});$F.displayName=Dle;var Ole="SelectPortal",BF=e=>v.jsx(jd,{asChild:!0,...e});BF.displayName=Ole;var ma="SelectContent",VF=S.forwardRef((e,t)=>{const n=Ns(ma,e.__scopeSelect),[r,i]=S.useState();if(Un(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?eu.createPortal(v.jsx(WF,{scope:e.__scopeSelect,children:v.jsx(Bm.Slot,{scope:e.__scopeSelect,children:v.jsx("div",{children:e.children})})}),o):null}return v.jsx(UF,{...e,ref:t})});VF.displayName=ma;var ri=10,[WF,Ts]=cu(ma),Ile="SelectContentImpl",UF=S.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:y,hideWhenDetached:x,avoidCollisions:k,...w}=e,E=Ns(ma,n),[C,N]=S.useState(null),[P,A]=S.useState(null),O=pt(t,ee=>N(ee)),[M,j]=S.useState(null),[R,$]=S.useState(null),F=Vm(n),[H,I]=S.useState(!1),Y=S.useRef(!1);S.useEffect(()=>{if(C)return Nm(C)},[C]),Cm();const q=S.useCallback(ee=>{const[re,...ue]=F().map(fe=>fe.ref.current),[he]=ue.slice(-1),be=document.activeElement;for(const fe of ee)if(fe===be||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===re&&P&&(P.scrollTop=0),fe===he&&P&&(P.scrollTop=P.scrollHeight),fe==null||fe.focus(),document.activeElement!==be))return},[F,P]),Z=S.useCallback(()=>q([M,C]),[q,M,C]);S.useEffect(()=>{H&&Z()},[H,Z]);const{onOpenChange:B,triggerPointerDownPosRef:W}=E;S.useEffect(()=>{if(C){let ee={x:0,y:0};const re=he=>{var be,fe;ee={x:Math.abs(Math.round(he.pageX)-(((be=W.current)==null?void 0:be.x)??0)),y:Math.abs(Math.round(he.pageY)-(((fe=W.current)==null?void 0:fe.y)??0))}},ue=he=>{ee.x<=10&&ee.y<=10?he.preventDefault():C.contains(he.target)||B(!1),document.removeEventListener("pointermove",re),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",ue,{capture:!0})}}},[C,B,W]),S.useEffect(()=>{const ee=()=>B(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[B]);const[L,U]=r4(ee=>{const re=F().filter(be=>!be.disabled),ue=re.find(be=>be.ref.current===document.activeElement),he=i4(re,ee,ue);he&&setTimeout(()=>he.ref.current.focus())}),V=S.useCallback((ee,re,ue)=>{const he=!Y.current&&!ue;(E.value!==void 0&&E.value===re||he)&&(j(ee),he&&(Y.current=!0))},[E.value]),D=S.useCallback(()=>C==null?void 0:C.focus(),[C]),G=S.useCallback((ee,re,ue)=>{const he=!Y.current&&!ue;(E.value!==void 0&&E.value===re||he)&&$(ee)},[E.value]),K=r==="popper"?Lw:HF,J=K===Lw?{side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:y,hideWhenDetached:x,avoidCollisions:k}:{};return v.jsx(WF,{scope:n,content:C,viewport:P,onViewportChange:A,itemRefCallback:V,selectedItem:M,onItemLeave:D,itemTextRefCallback:G,focusSelectedItem:Z,selectedItemText:R,position:r,isPositioned:H,searchRef:L,children:v.jsx(Ld,{as:Li,allowPinchZoom:!0,children:v.jsx(Id,{asChild:!0,trapped:E.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:Re(i,ee=>{var re;(re=E.trigger)==null||re.focus({preventScroll:!0}),ee.preventDefault()}),children:v.jsx(Od,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:v.jsx(K,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:ee=>ee.preventDefault(),...w,...J,onPlaced:()=>I(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Re(w.onKeyDown,ee=>{const re=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!re&&ee.key.length===1&&U(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let he=F().filter(be=>!be.disabled).map(be=>be.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const be=ee.target,fe=he.indexOf(be);he=he.slice(fe+1)}setTimeout(()=>q(he)),ee.preventDefault()}})})})})})})});UF.displayName=Ile;var jle="SelectItemAlignedPosition",HF=S.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Ns(ma,n),s=Ts(ma,n),[a,u]=S.useState(null),[c,f]=S.useState(null),h=pt(t,O=>f(O)),p=Vm(n),m=S.useRef(!1),y=S.useRef(!0),{viewport:x,selectedItem:k,selectedItemText:w,focusSelectedItem:E}=s,C=S.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&x&&k&&w){const O=o.trigger.getBoundingClientRect(),M=c.getBoundingClientRect(),j=o.valueNode.getBoundingClientRect(),R=w.getBoundingClientRect();if(o.dir!=="rtl"){const be=R.left-M.left,fe=j.left-be,ve=O.left-fe,Me=O.width+ve,$e=Math.max(Me,M.width),ct=window.innerWidth-ri,_t=M0(fe,[ri,Math.max(ri,ct-$e)]);a.style.minWidth=Me+"px",a.style.left=_t+"px"}else{const be=M.right-R.right,fe=window.innerWidth-j.right-be,ve=window.innerWidth-O.right-fe,Me=O.width+ve,$e=Math.max(Me,M.width),ct=window.innerWidth-ri,_t=M0(fe,[ri,Math.max(ri,ct-$e)]);a.style.minWidth=Me+"px",a.style.right=_t+"px"}const $=p(),F=window.innerHeight-ri*2,H=x.scrollHeight,I=window.getComputedStyle(c),Y=parseInt(I.borderTopWidth,10),q=parseInt(I.paddingTop,10),Z=parseInt(I.borderBottomWidth,10),B=parseInt(I.paddingBottom,10),W=Y+q+H+B+Z,L=Math.min(k.offsetHeight*5,W),U=window.getComputedStyle(x),V=parseInt(U.paddingTop,10),D=parseInt(U.paddingBottom,10),G=O.top+O.height/2-ri,K=F-G,J=k.offsetHeight/2,ee=k.offsetTop+J,re=Y+q+ee,ue=W-re;if(re<=G){const be=$.length>0&&k===$[$.length-1].ref.current;a.style.bottom="0px";const fe=c.clientHeight-x.offsetTop-x.offsetHeight,ve=Math.max(K,J+(be?D:0)+fe+Z),Me=re+ve;a.style.height=Me+"px"}else{const be=$.length>0&&k===$[0].ref.current;a.style.top="0px";const ve=Math.max(G,Y+x.offsetTop+(be?V:0)+J)+ue;a.style.height=ve+"px",x.scrollTop=re-G+x.offsetTop}a.style.margin=`${ri}px 0`,a.style.minHeight=L+"px",a.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,a,c,x,k,w,o.dir,r]);Un(()=>C(),[C]);const[N,P]=S.useState();Un(()=>{c&&P(window.getComputedStyle(c).zIndex)},[c]);const A=S.useCallback(O=>{O&&y.current===!0&&(C(),E==null||E(),y.current=!1)},[C,E]);return v.jsx(Fle,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:A,children:v.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:v.jsx(Ue.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});HF.displayName=jle;var Lle="SelectPopperPosition",Lw=S.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=ri,...o}=e,s=Wm(n);return v.jsx(U1,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Lw.displayName=Lle;var[Fle,yk]=cu(ma,{}),Fw="SelectViewport",YF=S.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Ts(Fw,n),s=yk(Fw,n),a=pt(t,o.onViewportChange),u=S.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),v.jsx(Bm.Slot,{scope:n,children:v.jsx(Ue.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Re(i.onScroll,c=>{const f=c.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=s;if(p!=null&&p.current&&h){const m=Math.abs(u.current-f.scrollTop);if(m>0){const y=window.innerHeight-ri*2,x=parseFloat(h.style.minHeight),k=parseFloat(h.style.height),w=Math.max(x,k);if(w<y){const E=w+m,C=Math.min(y,E),N=E-C;h.style.height=C+"px",h.style.bottom==="0px"&&(f.scrollTop=N>0?N:0,h.style.justifyContent="flex-end")}}}u.current=f.scrollTop})})})]})});YF.displayName=Fw;var qF="SelectGroup",[zle,$le]=cu(qF),Ble=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=En();return v.jsx(zle,{scope:n,id:i,children:v.jsx(Ue.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Ble.displayName=qF;var GF="SelectLabel",Vle=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=$le(GF,n);return v.jsx(Ue.div,{id:i.id,...r,ref:t})});Vle.displayName=GF;var $p="SelectItem",[Wle,ZF]=cu($p),KF=S.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=Ns($p,n),u=Ts($p,n),c=a.value===r,[f,h]=S.useState(o??""),[p,m]=S.useState(!1),y=pt(t,E=>{var C;return(C=u.itemRefCallback)==null?void 0:C.call(u,E,r,i)}),x=En(),k=S.useRef("touch"),w=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return v.jsx(Wle,{scope:n,value:r,disabled:i,textId:x,isSelected:c,onItemTextChange:S.useCallback(E=>{h(C=>C||((E==null?void 0:E.textContent)??"").trim())},[]),children:v.jsx(Bm.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:v.jsx(Ue.div,{role:"option","aria-labelledby":x,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:y,onFocus:Re(s.onFocus,()=>m(!0)),onBlur:Re(s.onBlur,()=>m(!1)),onClick:Re(s.onClick,()=>{k.current!=="mouse"&&w()}),onPointerUp:Re(s.onPointerUp,()=>{k.current==="mouse"&&w()}),onPointerDown:Re(s.onPointerDown,E=>{k.current=E.pointerType}),onPointerMove:Re(s.onPointerMove,E=>{var C;k.current=E.pointerType,i?(C=u.onItemLeave)==null||C.call(u):k.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(s.onPointerLeave,E=>{var C;E.currentTarget===document.activeElement&&((C=u.onItemLeave)==null||C.call(u))}),onKeyDown:Re(s.onKeyDown,E=>{var N;((N=u.searchRef)==null?void 0:N.current)!==""&&E.key===" "||(Tle.includes(E.key)&&w(),E.key===" "&&E.preventDefault())})})})})});KF.displayName=$p;var xc="SelectItemText",XF=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=Ns(xc,n),a=Ts(xc,n),u=ZF(xc,n),c=Mle(xc,n),[f,h]=S.useState(null),p=pt(t,w=>h(w),u.onItemTextChange,w=>{var E;return(E=a.itemTextRefCallback)==null?void 0:E.call(a,w,u.value,u.disabled)}),m=f==null?void 0:f.textContent,y=S.useMemo(()=>v.jsx("option",{value:u.value,disabled:u.disabled,children:m},u.value),[u.disabled,u.value,m]),{onNativeOptionAdd:x,onNativeOptionRemove:k}=c;return Un(()=>(x(y),()=>k(y)),[x,k,y]),v.jsxs(v.Fragment,{children:[v.jsx(Ue.span,{id:u.textId,...o,ref:p}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?eu.createPortal(o.children,s.valueNode):null]})});XF.displayName=xc;var QF="SelectItemIndicator",JF=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return ZF(QF,n).isSelected?v.jsx(Ue.span,{"aria-hidden":!0,...r,ref:t}):null});JF.displayName=QF;var zw="SelectScrollUpButton",Ule=S.forwardRef((e,t)=>{const n=Ts(zw,e.__scopeSelect),r=yk(zw,e.__scopeSelect),[i,o]=S.useState(!1),s=pt(t,r.onScrollButtonChange);return Un(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=u.scrollTop>0;o(c)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?v.jsx(e4,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop-u.offsetHeight)}}):null});Ule.displayName=zw;var $w="SelectScrollDownButton",Hle=S.forwardRef((e,t)=>{const n=Ts($w,e.__scopeSelect),r=yk($w,e.__scopeSelect),[i,o]=S.useState(!1),s=pt(t,r.onScrollButtonChange);return Un(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=u.scrollHeight-u.clientHeight,f=Math.ceil(u.scrollTop)<c;o(f)};const u=n.viewport;return a(),u.addEventListener("scroll",a),()=>u.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?v.jsx(e4,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:u}=n;a&&u&&(a.scrollTop=a.scrollTop+u.offsetHeight)}}):null});Hle.displayName=$w;var e4=S.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Ts("SelectScrollButton",n),s=S.useRef(null),a=Vm(n),u=S.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return S.useEffect(()=>()=>u(),[u]),Un(()=>{var f;const c=a().find(h=>h.ref.current===document.activeElement);(f=c==null?void 0:c.ref.current)==null||f.scrollIntoView({block:"nearest"})},[a]),v.jsx(Ue.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Re(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Re(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Re(i.onPointerLeave,()=>{u()})})}),Yle="SelectSeparator",qle=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return v.jsx(Ue.div,{"aria-hidden":!0,...r,ref:t})});qle.displayName=Yle;var Bw="SelectArrow",Gle=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Wm(n),o=Ns(Bw,n),s=Ts(Bw,n);return o.open&&s.position==="popper"?v.jsx(H1,{...i,...r,ref:t}):null});Gle.displayName=Bw;function t4(e){return e===""||e===void 0}var n4=S.forwardRef((e,t)=>{const{value:n,...r}=e,i=S.useRef(null),o=pt(t,i),s=TL(n);return S.useEffect(()=>{const a=i.current,u=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==n&&f){const h=new Event("change",{bubbles:!0});f.call(a,n),a.dispatchEvent(h)}},[s,n]),v.jsx(OF,{asChild:!0,children:v.jsx("select",{...r,ref:o,defaultValue:n})})});n4.displayName="BubbleSelect";function r4(e){const t=fn(e),n=S.useRef(""),r=S.useRef(0),i=S.useCallback(s=>{const a=n.current+s;t(a),function u(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(a)},[t]),o=S.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function i4(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=Zle(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const u=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function Zle(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Kle=IF,o4=LF,Xle=zF,Qle=$F,Jle=BF,s4=VF,eue=YF,a4=KF,tue=XF,nue=JF;const rue=Kle,iue=Xle,l4=S.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(o4,{ref:r,className:Te("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:[t,v.jsx(Qle,{asChild:!0,children:v.jsx(hb,{className:"h-4 w-4 opacity-50"})})]}));l4.displayName=o4.displayName;const u4=S.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>v.jsx(Jle,{children:v.jsx(s4,{ref:i,className:Te("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:v.jsx(eue,{className:Te("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));u4.displayName=s4.displayName;const c4=S.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(a4,{ref:r,className:Te("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(nue,{children:v.jsx(fb,{className:"h-4 w-4"})})}),v.jsx(tue,{children:t})]}));c4.displayName=a4.displayName;function xx({name:e,control:t,options:n,handleFieldChange:r}){return v.jsx(uu,{name:e,control:t,render:({field:i})=>v.jsxs(rue,{value:i.value,onValueChange:o=>{i.onChange(o),r==null||r({key:e,value:o})},children:[v.jsx(l4,{children:v.jsx(iue,{placeholder:"Select an option"})}),v.jsx(u4,{children:n.map(o=>v.jsx(c4,{value:o.value,children:o.label},o.value))})]})})}const d4=S.forwardRef(({className:e,...t},n)=>v.jsx("textarea",{className:Te("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));d4.displayName="Textarea";function oue({name:e,control:t,handleFieldChange:n,isMultiline:r,placeholder:i}){const o=r?d4:Kd;return v.jsx(uu,{name:e,control:t,render:({field:s})=>v.jsx(o,{...s,placeholder:i,onChange:a=>{s.onChange(a),n==null||n({key:e,value:a.target.value})}})})}const Bp=(e,t=" ")=>e.split(t).map(n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).join(" ");var sue="Label",f4=S.forwardRef((e,t)=>v.jsx(Ue.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));f4.displayName=sue;var h4=f4;const aue=nu("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Um=S.forwardRef(({className:e,...t},n)=>v.jsx(h4,{ref:n,className:Te(aue(),e),...t}));Um.displayName=h4.displayName;const lue=nu("block",{variants:{variant:{primary:"text-text",secondary:"text-text-dim"},size:{default:"text-base",xs:"text-xs",sm:"text-sm",md:"text-md",lg:"text-lg",xl:"text-xl","2xl":"text-2xl"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"}},defaultVariants:{variant:"primary",size:"default",weight:"normal"}}),hn=({className:e,weight:t,variant:n,as:r="span",size:i,...o})=>v.jsx(r,{className:Te(lue({size:i,variant:n,weight:t,className:e})),...o}),uue=(e,t)=>(typeof t=="string"&&(t=t==null?void 0:t.split(".")),t==null?void 0:t.reduce((n,r)=>n&&n[r]!==void 0?n[r]:void 0,e)),cue=(e,t=[],n)=>{let r={};function i(o,s){for(const[a,u]of Object.entries(o)){let c=[...s,a];u&&u.constructor===Object?(t!=null&&t.length?t.every(h=>Object.keys(u).includes(h)):!1)?r={...r,[c.join(".")]:u}:i(u,c):r={...r,[c.join(".")]:u}}}return i(e,[]),r};var Kn=(e=>(e.STRING="STRING",e.NUMBER="NUMBER",e.DATE="DATE",e.ENUM="ENUM",e.ARRAY="ARRAY",e.BOOLEAN="BOOLEAN",e.RECORD="RECORD",e.OBJECT="OBJECT",e.UNION="UNION",e.CREATABLE="CREATABLE",e.SELECT="SELECT",e.MULTI_SELECT="MULTI_SELECT",e))(Kn||{});function Vl({schema:e,isOptional:t=!1}){return e instanceof Qt.ZodObject?{type:"OBJECT",isOptional:t}:e instanceof Qt.ZodString?e instanceof Qt.ZodString&&e._def.checks.some(n=>n.kind==="datetime")?{type:"DATE",isOptional:t}:{type:"STRING",isOptional:t}:e instanceof So?{type:"NUMBER",isOptional:t}:e instanceof jl?{type:"BOOLEAN",isOptional:t}:e instanceof xs?{type:"DATE",isOptional:t}:e instanceof Fl?{type:"ENUM",isOptional:t,options:[{label:e.value,value:e.value}]}:e instanceof Bi?{type:"ENUM",isOptional:t,options:e.options.map(n=>({label:n,value:n}))}:e instanceof Ar?{type:"ARRAY",isOptional:t,options:e.element instanceof Bi?e.element.options.map(n=>({label:n,value:n})):[]}:e instanceof Qt.ZodOptional||e instanceof Qt.ZodDefault?Vl({schema:e._def.innerType,isOptional:!0}):e instanceof Qt.ZodEffects?Vl({schema:e._def.schema,isOptional:t}):e instanceof Qt.ZodRecord?{type:"RECORD",isOptional:t,innerSchema:e._def.valueType}:{type:"STRING",isOptional:t}}function due({schema:e,errors:t,renderFieldMap:n,schemaField:r,renderLabel:i,control:o,variables:s,onFieldChange:a,schemaOptions:u,values:c,isOptional:f=!1,isNullable:h=!1}){var k,w;const p=Vl({schema:e,isOptional:f}),m=u!=null&&u.parentField?uue(c,u==null?void 0:u.parentField):"";if(u!=null&&u.parentField&&!m)return null;if(!n)return;const y=cue(t,["message","type"]),x=u!=null&&u.parentField?(k=u==null?void 0:u.options)==null?void 0:k[m]:(u==null?void 0:u.options)||p.options;return v.jsxs("div",{className:"flex flex-col gap-1 mt-3",children:[i?i({isOptional:!!p.isOptional,schemaField:r}):v.jsxs(Um,{className:"flex gap-0.5 capitalize",htmlFor:r,"aria-required":!p.isOptional,children:[!(p!=null&&p.isOptional)&&v.jsx("span",{className:"text-red-500",children:"*"}),v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3",size:"xs",children:Bp(r.split(".").pop()||"")})]}),n[p.type]({name:r,options:x,control:o,variables:s,innerSchema:p.innerSchema,handleFieldChange:a,isNullable:h}),y!=null&&y[r]?v.jsx(hn,{size:"xs",className:"text-red-500",children:(w=y[r])==null?void 0:w.message}):null]},r)}function p4({renderDynamicForm:e,schema:t,handleFieldChange:n,control:r,formValues:i,errors:o,parentField:s,action:a,isOptional:u=!1,isNullable:c=!1,depth:f}){const h=Vl({schema:t,isOptional:u});if(t instanceof da){const p=t.options;return v.jsxs("div",{children:[v.jsxs(Um,{className:"flex gap-0.5 capitalize mb-2",htmlFor:s,"aria-required":!h.isOptional,children:[!(h!=null&&h.isOptional)&&v.jsx("span",{className:"text-red-500",children:"*"}),v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3",size:"xs",children:Bp(s)})]}),v.jsx("div",{className:"flex flex-col gap-4",children:p.map((m,y)=>v.jsxs(S.Fragment,{children:[y>=1&&v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 text-center",size:"xs",children:"or"}),v.jsx("div",{className:"ring-1 ring-white/10 p-2 rounded-md relative",children:e({schema:m,handleFieldChange:n,control:r,formValues:i,errors:o,parentField:s,action:a,isOptional:u,isNullable:c,depth:f})})]},y))})]})}return null}function m4({renderDynamicForm:e,schema:t,handleFieldChange:n,control:r,formValues:i,errors:o,parentField:s,action:a,isArray:u=!1,isOptional:c=!1,depth:f}){const h=Vl({schema:t,isOptional:c}),{fields:p,append:m,remove:y}=lk({control:r,name:s});function x(){m({})}return v.jsxs("div",{children:[v.jsxs(Um,{className:"flex gap-0.5 capitalize mb-2",htmlFor:s,"aria-required":!h.isOptional,children:[!(h!=null&&h.isOptional)&&v.jsx("span",{className:"text-red-500",children:"*"}),v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3",size:"xs",children:Bp(s)})]}),u?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"flex flex-col gap-4",children:p.map((k,w)=>v.jsxs("div",{className:"ring-1 ring-white/10 p-2 rounded-md relative",children:[v.jsx(Bt,{type:"button",variant:"ghost",size:"icon",onClick:()=>y(w),className:"absolute top-0 right-0",children:v.jsx(va,{className:"text-icon h-3.5 w-3.5"})}),e({schema:t instanceof Ar?t.element:t,handleFieldChange:n,control:r,formValues:i,errors:o,parentField:`${s}.${w}`,action:a,isOptional:c,depth:f})]},k.id))}),v.jsx("div",{className:"flex flex-col gap-4",children:v.jsxs(Bt,{type:"button",variant:"outline",className:"w-full text-xs h-9",onClick:x,children:["Add ",Bp(s.split(".").pop()||"")]})})]}):v.jsx("div",{className:"ring-1 ring-white/10 p-2 rounded-md relative",children:e({schema:t,handleFieldChange:n,control:r,formValues:i,errors:o,parentField:s,action:a,isOptional:c,depth:f})})]})}function fue({name:e,control:t,handleFieldChange:n}){return v.jsx(uu,{name:e,control:t,render:({field:r})=>v.jsx(Kd,{...r,type:"number",onChange:i=>{const o=i.target.value===""?void 0:Number(i.target.value);r.onChange(o),n==null||n({key:e,value:o})}})})}function hue({name:e,control:t,renderField:n}){const{fields:r,append:i,remove:o}=lk({control:t,name:e});return v.jsxs("div",{className:"space-y-3",children:[r.map((s,a)=>v.jsxs("div",{className:"relative space-y-2 rounded-lg border p-4",children:[v.jsx(Bt,{type:"button",variant:"ghost",size:"icon",className:"absolute right-2 top-2",onClick:()=>o(a),children:v.jsx(va,{className:"h-4 w-4"})}),v.jsxs("div",{className:"space-y-2",children:[v.jsx(Kd,{placeholder:"Key",...t.register(`${e}.${a}.key`)}),n({fieldName:`${e}.${a}.value`,index:a})]})]},s.id)),v.jsxs(Bt,{type:"button",variant:"outline",size:"sm",className:"w-full",onClick:()=>i({key:"",value:""}),children:[v.jsx(jc,{className:"mr-2 h-4 w-4"}),"Add Key-Value Pair"]})]})}function ep(){return{[Kn.STRING]:e=>{const{options:t,...n}=e;return t!=null&&t.length?v.jsx(xx,{...n,options:t}):v.jsx(oue,{...n})},[Kn.NUMBER]:e=>v.jsx(fue,{...e}),[Kn.BOOLEAN]:e=>v.jsx(Vie,{...e}),[Kn.DATE]:e=>v.jsx(Cle,{...e}),[Kn.ENUM]:e=>{const{options:t=[]}=e;return v.jsx(xx,{...e,options:t})},[Kn.ARRAY]:e=>{const t=({fieldName:n,index:r})=>ep()[Kn.STRING]({...e,name:n});return v.jsx(jie,{...e,renderField:t})},[Kn.RECORD]:e=>{const t=({fieldName:n,index:r})=>ep()[Kn.STRING]({...e,name:n});return v.jsx(hue,{...e,renderField:t})},[Kn.OBJECT]:e=>{const{innerSchema:t,name:n,control:r,handleFieldChange:i}=e;return t?v.jsx(m4,{schema:t,control:r,parentField:n,handleFieldChange:(o,s)=>i({key:o,value:s}),formValues:{},errors:{},renderDynamicForm:o=>Vp({...o,handleFieldChange:i})}):null},[Kn.UNION]:e=>{const{innerSchema:t,name:n,control:r,handleFieldChange:i}=e;return!t||!(t instanceof da)?null:v.jsx(p4,{schema:t,control:r,parentField:n,handleFieldChange:(o,s)=>i({key:o,value:s}),renderDynamicForm:o=>{const s=Vl({schema:o.schema});return ep()[s.type]({...e,...o,control:r,handleFieldChange:i})},formValues:{},errors:{}})},[Kn.CREATABLE]:e=>v.jsx(PT,{...e}),[Kn.SELECT]:e=>{const{options:t=[]}=e;return v.jsx(xx,{...e,options:t})},[Kn.MULTI_SELECT]:e=>v.jsx(PT,{...e})}}function pue(e){return(t,n)=>e({key:t,value:n})}function Vp({schema:e,parentField:t,control:n,formValues:r,errors:i,handleFieldChange:o,isOptional:s=!1,isNullable:a=!1,depth:u=0}){return u>10?(console.warn("Maximum schema resolution depth reached. Possible circular reference."),null):e instanceof Qt.ZodObject?Object.entries(e.shape).map(([c,f])=>{const h=t?`${t}.${c}`:c;return Mc({schema:f,parentField:h,control:n,formValues:r,errors:i,handleFieldChange:o,isOptional:s,isNullable:a})}):Mc({schema:e,parentField:t,control:n,formValues:r,errors:i,handleFieldChange:o,isOptional:s,isNullable:a})}function Mc({schema:e,parentField:t,control:n,formValues:r,errors:i,handleFieldChange:o,isOptional:s=!1,isNullable:a=!1}){if(e instanceof Qt.ZodDefault)return null;if(e instanceof Qt.ZodOptional)return Mc({schema:e._def.innerType,parentField:t,control:n,formValues:r,errors:i,handleFieldChange:o,isOptional:!0,isNullable:a});if(e instanceof Qt.ZodObject)return v.jsx("div",{className:"flex flex-col gap-8 py-8",children:v.jsx(m4,{schema:e,control:n,parentField:t,handleFieldChange:(u,c)=>o({key:u,value:c}),formValues:r,errors:i,isOptional:s,renderDynamicForm:u=>Vp({...u,handleFieldChange:o})})},t);if(e instanceof Qt.ZodUnion){if(e.options.some(u=>u instanceof Qt.ZodNull)){const u=e.options.find(c=>!(c instanceof Qt.ZodNull));return Mc({schema:Qt.optional(u),parentField:t,control:n,formValues:r,errors:i,handleFieldChange:o,isNullable:!0})}return v.jsx(p4,{schema:e,control:n,parentField:t,handleFieldChange:pue(o),formValues:r,errors:i,isOptional:s,isNullable:a,renderDynamicForm:u=>Vp({...u,handleFieldChange:c=>o(c)})})}return e instanceof Qt.ZodArray?Mc({schema:e.element,parentField:t,control:n,formValues:r,errors:i,handleFieldChange:o,isOptional:s,isNullable:a}):v.jsx("div",{children:due({schema:e,schemaField:t,control:n,values:r,errors:i,renderFieldMap:ep(),onFieldChange:o})},t)}function vk({schema:e,onSubmit:t,onChange:n,isSubmitLoading:r,submitButtonLabel:i="Submit"}){var k,w,E;const o=(k=e==null?void 0:e._def)==null?void 0:k.typeName,s=(w=e==null?void 0:e._def)==null?void 0:w.options,a=(E=e==null?void 0:e._def)==null?void 0:E.discriminator,u=Aie({resolver:o==="ZodDiscriminatedUnion"?Iie(e,a):Die(e)}),{control:c,handleSubmit:f,watch:h}=u,p=u.watch(),m=a?h(a):void 0,y=o==="ZodDiscriminatedUnion"?(s==null?void 0:s.find(C=>{var N,P,A;return((A=(P=(N=C==null?void 0:C.shape)==null?void 0:N[a])==null?void 0:P._def)==null?void 0:A.value)===m}))||Qt.object({[a]:Qt.string()}):e;S.useEffect(()=>{n==null||n(p)},[p,n]);function x({key:C,value:N}){C===a?(u.setValue(C,N),n==null||n({...p,[C]:N})):(u.setValue(C,N),n==null||n({...p,[C]:N}))}return v.jsx(fr,{className:"h-full w-full",children:v.jsxs("form",{onSubmit:f(t),className:"flex flex-col gap-4 p-4",children:[Vp({schema:y,parentField:"",control:c,formValues:p,errors:u.formState.errors,handleFieldChange:x}),v.jsx(Bt,{disabled:r,type:"submit",children:r?v.jsx(GB,{className:"h-4 w-4 animate-spin"}):i})]})})}var mue=Object.create,Hm=Object.defineProperty,gue=Object.defineProperties,yue=Object.getOwnPropertyDescriptor,vue=Object.getOwnPropertyDescriptors,g4=Object.getOwnPropertyNames,Wp=Object.getOwnPropertySymbols,xue=Object.getPrototypeOf,xk=Object.prototype.hasOwnProperty,y4=Object.prototype.propertyIsEnumerable,VT=(e,t,n)=>t in e?Hm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ii=(e,t)=>{for(var n in t||(t={}))xk.call(t,n)&&VT(e,n,t[n]);if(Wp)for(var n of Wp(t))y4.call(t,n)&&VT(e,n,t[n]);return e},Ym=(e,t)=>gue(e,vue(t)),v4=(e,t)=>{var n={};for(var r in e)xk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wp)for(var r of Wp(e))t.indexOf(r)<0&&y4.call(e,r)&&(n[r]=e[r]);return n},wue=(e,t)=>function(){return t||(0,e[g4(e)[0]])((t={exports:{}}).exports,t),t.exports},bue=(e,t)=>{for(var n in t)Hm(e,n,{get:t[n],enumerable:!0})},kue=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of g4(t))!xk.call(e,i)&&i!==n&&Hm(e,i,{get:()=>t[i],enumerable:!(r=yue(t,i))||r.enumerable});return e},Sue=(e,t,n)=>(n=e!=null?mue(xue(e)):{},kue(!e||!e.__esModule?Hm(n,"default",{value:e,enumerable:!0}):n,e)),Eue=wue({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,o={},s={util:{encode:function y(x){return x instanceof a?new a(x.type,y(x.content),x.alias):Array.isArray(x)?x.map(y):x.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++i}),y.__id},clone:function y(x,k){k=k||{};var w,E;switch(s.util.type(x)){case"Object":if(E=s.util.objId(x),k[E])return k[E];w={},k[E]=w;for(var C in x)x.hasOwnProperty(C)&&(w[C]=y(x[C],k));return w;case"Array":return E=s.util.objId(x),k[E]?k[E]:(w=[],k[E]=w,x.forEach(function(N,P){w[P]=y(N,k)}),w);default:return x}},getLanguage:function(y){for(;y;){var x=r.exec(y.className);if(x)return x[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,x){y.className=y.className.replace(RegExp(r,"gi"),""),y.classList.add("language-"+x)},isActive:function(y,x,k){for(var w="no-"+x;y;){var E=y.classList;if(E.contains(x))return!0;if(E.contains(w))return!1;y=y.parentElement}return!!k}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(y,x){var k=s.util.clone(s.languages[y]);for(var w in x)k[w]=x[w];return k},insertBefore:function(y,x,k,w){w=w||s.languages;var E=w[y],C={};for(var N in E)if(E.hasOwnProperty(N)){if(N==x)for(var P in k)k.hasOwnProperty(P)&&(C[P]=k[P]);k.hasOwnProperty(N)||(C[N]=E[N])}var A=w[y];return w[y]=C,s.languages.DFS(s.languages,function(O,M){M===A&&O!=y&&(this[O]=C)}),C},DFS:function y(x,k,w,E){E=E||{};var C=s.util.objId;for(var N in x)if(x.hasOwnProperty(N)){k.call(x,N,x[N],w||N);var P=x[N],A=s.util.type(P);A==="Object"&&!E[C(P)]?(E[C(P)]=!0,y(P,k,null,E)):A==="Array"&&!E[C(P)]&&(E[C(P)]=!0,y(P,k,N,E))}}},plugins:{},highlight:function(y,x,k){var w={code:y,grammar:x,language:k};if(s.hooks.run("before-tokenize",w),!w.grammar)throw new Error('The language "'+w.language+'" has no grammar.');return w.tokens=s.tokenize(w.code,w.grammar),s.hooks.run("after-tokenize",w),a.stringify(s.util.encode(w.tokens),w.language)},tokenize:function(y,x){var k=x.rest;if(k){for(var w in k)x[w]=k[w];delete x.rest}var E=new f;return h(E,E.head,y),c(y,E,x,E.head,0),m(E)},hooks:{all:{},add:function(y,x){var k=s.hooks.all;k[y]=k[y]||[],k[y].push(x)},run:function(y,x){var k=s.hooks.all[y];if(!(!k||!k.length))for(var w=0,E;E=k[w++];)E(x)}},Token:a};function a(y,x,k,w){this.type=y,this.content=x,this.alias=k,this.length=(w||"").length|0}a.stringify=function y(x,k){if(typeof x=="string")return x;if(Array.isArray(x)){var w="";return x.forEach(function(A){w+=y(A,k)}),w}var E={type:x.type,content:y(x.content,k),tag:"span",classes:["token",x.type],attributes:{},language:k},C=x.alias;C&&(Array.isArray(C)?Array.prototype.push.apply(E.classes,C):E.classes.push(C)),s.hooks.run("wrap",E);var N="";for(var P in E.attributes)N+=" "+P+'="'+(E.attributes[P]||"").replace(/"/g,"&quot;")+'"';return"<"+E.tag+' class="'+E.classes.join(" ")+'"'+N+">"+E.content+"</"+E.tag+">"};function u(y,x,k,w){y.lastIndex=x;var E=y.exec(k);if(E&&w&&E[1]){var C=E[1].length;E.index+=C,E[0]=E[0].slice(C)}return E}function c(y,x,k,w,E,C){for(var N in k)if(!(!k.hasOwnProperty(N)||!k[N])){var P=k[N];P=Array.isArray(P)?P:[P];for(var A=0;A<P.length;++A){if(C&&C.cause==N+","+A)return;var O=P[A],M=O.inside,j=!!O.lookbehind,R=!!O.greedy,$=O.alias;if(R&&!O.pattern.global){var F=O.pattern.toString().match(/[imsuy]*$/)[0];O.pattern=RegExp(O.pattern.source,F+"g")}for(var H=O.pattern||O,I=w.next,Y=E;I!==x.tail&&!(C&&Y>=C.reach);Y+=I.value.length,I=I.next){var q=I.value;if(x.length>y.length)return;if(!(q instanceof a)){var Z=1,B;if(R){if(B=u(H,Y,y,j),!B||B.index>=y.length)break;var V=B.index,W=B.index+B[0].length,L=Y;for(L+=I.value.length;V>=L;)I=I.next,L+=I.value.length;if(L-=I.value.length,Y=L,I.value instanceof a)continue;for(var U=I;U!==x.tail&&(L<W||typeof U.value=="string");U=U.next)Z++,L+=U.value.length;Z--,q=y.slice(Y,L),B.index-=Y}else if(B=u(H,0,q,j),!B)continue;var V=B.index,D=B[0],G=q.slice(0,V),K=q.slice(V+D.length),J=Y+q.length;C&&J>C.reach&&(C.reach=J);var ee=I.prev;G&&(ee=h(x,ee,G),Y+=G.length),p(x,ee,Z);var re=new a(N,M?s.tokenize(D,M):D,$,D);if(I=h(x,ee,re),K&&h(x,I,K),Z>1){var ue={cause:N+","+A,reach:J};c(y,x,k,I.prev,Y,ue),C&&ue.reach>C.reach&&(C.reach=ue.reach)}}}}}}function f(){var y={value:null,prev:null,next:null},x={value:null,prev:y,next:null};y.next=x,this.head=y,this.tail=x,this.length=0}function h(y,x,k){var w=x.next,E={value:k,prev:x,next:w};return x.next=E,w.prev=E,y.length++,E}function p(y,x,k){for(var w=x.next,E=0;E<k&&w!==y.tail;E++)w=w.next;x.next=w,w.prev=x,y.length-=E}function m(y){for(var x=[],k=y.head.next;k!==y.tail;)x.push(k.value),k=k.next;return x}return s}();t.exports=n,n.default=n}}),me=Sue(Eue());me.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},me.languages.markup.tag.inside["attr-value"].inside.entity=me.languages.markup.entity,me.languages.markup.doctype.inside["internal-subset"].inside=me.languages.markup,me.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(me.languages.markup.tag,"addInlined",{value:function(e,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:me.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:me.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},me.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(me.languages.markup.tag,"addAttribute",{value:function(e,t){me.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:me.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),me.languages.html=me.languages.markup,me.languages.mathml=me.languages.markup,me.languages.svg=me.languages.markup,me.languages.xml=me.languages.extend("markup",{}),me.languages.ssml=me.languages.xml,me.languages.atom=me.languages.xml,me.languages.rss=me.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(me),me.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},me.languages.javascript=me.languages.extend("clike",{"class-name":[me.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),me.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,me.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:me.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:me.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:me.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:me.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:me.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),me.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:me.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),me.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),me.languages.markup&&(me.languages.markup.tag.addInlined("script","javascript"),me.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),me.languages.js=me.languages.javascript,me.languages.actionscript=me.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),me.languages.actionscript["class-name"].alias="function",delete me.languages.actionscript.parameter,delete me.languages.actionscript["literal-property"],me.languages.markup&&me.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:me.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(me),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(i){var o=function(h){h.inside||(h.inside={}),h.inside.rest=r},s="doc-comment";if(a=e.languages[i]){var a,u=a[s];if((u=u||(a=e.languages.insertBefore(i,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[s])instanceof RegExp&&(u=a[s]={pattern:u}),Array.isArray(u))for(var c=0,f=u.length;c<f;c++)u[c]instanceof RegExp&&(u[c]={pattern:u[c]}),o(u[c]);else o(u)}})}}),t.addSupport(["java","javascript","php"],t)}(me),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(me),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(me),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function s(a,u){u=(u||"").replace(/m/g,"")+"m";var c=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return a});return RegExp(c,u)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+i+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:s(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:s(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:s(o),lookbehind:!0,greedy:!0},number:{pattern:s(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(me),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(c){return c=c.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+c+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,s=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+o+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+o+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(c){["url","bold","italic","strike","code-snippet"].forEach(function(f){c!==f&&(e.languages.markdown[c].inside.content.inside[f]=e.languages.markdown[f])})}),e.hooks.add("after-tokenize",function(c){c.language!=="markdown"&&c.language!=="md"||function f(h){if(h&&typeof h!="string")for(var p=0,m=h.length;p<m;p++){var y,x=h[p];x.type!=="code"?f(x.content):(y=x.content[1],x=x.content[3],y&&x&&y.type==="code-language"&&x.type==="code-block"&&typeof y.content=="string"&&(y=y.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),y="language-"+(y=(/[a-z][\w-]*/i.exec(y)||[""])[0].toLowerCase()),x.alias?typeof x.alias=="string"?x.alias=[x.alias,y]:x.alias.push(y):x.alias=[y]))}}(c.tokens)}),e.hooks.add("wrap",function(c){if(c.type==="code-block"){for(var f="",h=0,p=c.classes.length;h<p;h++){var m=c.classes[h],m=/language-(.+)/.exec(m);if(m){f=m[1];break}}var y,x=e.languages[f];x?c.content=e.highlight(function(k){return k=k.replace(s,""),k=k.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(w,E){var C;return(E=E.toLowerCase())[0]==="#"?(C=E[1]==="x"?parseInt(E.slice(2),16):Number(E.slice(1)),u(C)):a[E]||w})}(c.content),x,f):f&&f!=="none"&&e.plugins.autoloader&&(y="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),c.attributes.id=y,e.plugins.autoloader.loadLanguages(f,function(){var k=document.getElementById(y);k&&(k.innerHTML=e.highlight(k.textContent,e.languages[f],f))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),a={amp:"&",lt:"<",gt:">",quot:'"'},u=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(me),me.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:me.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},me.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var t=e.tokens.filter(function(y){return typeof y!="string"&&y.type!=="comment"&&y.type!=="scalar"}),n=0;n<t.length;){var r=t[n++];if(r.type==="keyword"&&r.content==="mutation"){var i=[];if(h(["definition-mutation","punctuation"])&&f(1).content==="("){n+=2;var o=p(/^\($/,/^\)$/);if(o===-1)continue;for(;n<o;n++){var s=f(0);s.type==="variable"&&(m(s,"variable-input"),i.push(s.content))}n=o+1}if(h(["punctuation","property-query"])&&f(0).content==="{"&&(n++,m(f(0),"property-mutation"),0<i.length)){var a=p(/^\{$/,/^\}$/);if(a!==-1)for(var u=n;u<a;u++){var c=t[u];c.type==="variable"&&0<=i.indexOf(c.content)&&m(c,"variable-input")}}}}function f(y){return t[n+y]}function h(y,x){x=x||0;for(var k=0;k<y.length;k++){var w=f(k+x);if(!w||w.type!==y[k])return}return 1}function p(y,x){for(var k=1,w=n;w<t.length;w++){var E=t[w],C=E.content;if(E.type==="punctuation"&&typeof C=="string"){if(y.test(C))k++;else if(x.test(C)&&--k===0)return w}}return-1}function m(y,x){var k=y.alias;k?Array.isArray(k)||(y.alias=k=[k]):y.alias=k=[],k.push(x)}}),me.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,i=r.inside["interpolation-punctuation"],o=r.pattern.source;function s(h,p){if(e.languages[h])return{pattern:RegExp("((?:"+p+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:h}}}}function a(h,p,m){return h={code:h,grammar:p,language:m},e.hooks.run("before-tokenize",h),h.tokens=e.tokenize(h.code,h.grammar),e.hooks.run("after-tokenize",h),h.tokens}function u(h,p,m){var k=e.tokenize(h,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),y=0,x={},k=a(k.map(function(E){if(typeof E=="string")return E;for(var C,N,E=E.content;h.indexOf((N=y++,C="___"+m.toUpperCase()+"_"+N+"___"))!==-1;);return x[C]=E,C}).join(""),p,m),w=Object.keys(x);return y=0,function E(C){for(var N=0;N<C.length;N++){if(y>=w.length)return;var P,A,O,M,j,R,$,F=C[N];typeof F=="string"||typeof F.content=="string"?(P=w[y],($=(R=typeof F=="string"?F:F.content).indexOf(P))!==-1&&(++y,A=R.substring(0,$),j=x[P],O=void 0,(M={})["interpolation-punctuation"]=i,(M=e.tokenize(j,M)).length===3&&((O=[1,1]).push.apply(O,a(M[1],e.languages.javascript,"javascript")),M.splice.apply(M,O)),O=new e.Token("interpolation",M,r.alias,j),M=R.substring($+P.length),j=[],A&&j.push(A),j.push(O),M&&(E(R=[M]),j.push.apply(j,R)),typeof F=="string"?(C.splice.apply(C,[N,1].concat(j)),N+=j.length-1):F.content=j)):($=F.content,Array.isArray($)?E($):E([$]))}}(k),new e.Token(m,k,"language-"+m,h)}e.languages.javascript["template-string"]=[s("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),s("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),s("svg",/\bsvg/.source),s("markdown",/\b(?:markdown|md)/.source),s("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),s("sql",/\bsql/.source),t].filter(Boolean);var c={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(h){return typeof h=="string"?h:Array.isArray(h)?h.map(f).join(""):f(h.content)}e.hooks.add("after-tokenize",function(h){h.language in c&&function p(m){for(var y=0,x=m.length;y<x;y++){var k,w,E,C=m[y];typeof C!="string"&&(k=C.content,Array.isArray(k)?C.type==="template-string"?(C=k[1],k.length===3&&typeof C!="string"&&C.type==="embedded-code"&&(w=f(C),C=C.alias,C=Array.isArray(C)?C[0]:C,E=e.languages[C])&&(k[1]=u(w,E,C))):p(k):typeof k!="string"&&p([k]))}}(h.tokens)})}(me),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(me),function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(me),function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(me),me.languages.n4js=me.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),me.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),me.languages.n4jsd=me.languages.n4js,function(e){function t(s,a){return RegExp(s.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),a)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var o=n[r],i=e.languages.javascript[o],o=(i=e.util.type(i)==="RegExp"?e.languages.javascript[o]={pattern:i}:i).inside||{};(i.inside=o)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(me),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function o(u,c){return u=u.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(u,c)}i=o(i).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:o(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function s(u){for(var c=[],f=0;f<u.length;f++){var h=u[f],p=!1;typeof h!="string"&&(h.type==="tag"&&h.content[0]&&h.content[0].type==="tag"?h.content[0].content[0].content==="</"?0<c.length&&c[c.length-1].tagName===a(h.content[0].content[1])&&c.pop():h.content[h.content.length-1].content!=="/>"&&c.push({tagName:a(h.content[0].content[1]),openedBraces:0}):0<c.length&&h.type==="punctuation"&&h.content==="{"?c[c.length-1].openedBraces++:0<c.length&&0<c[c.length-1].openedBraces&&h.type==="punctuation"&&h.content==="}"?c[c.length-1].openedBraces--:p=!0),(p||typeof h=="string")&&0<c.length&&c[c.length-1].openedBraces===0&&(p=a(h),f<u.length-1&&(typeof u[f+1]=="string"||u[f+1].type==="plain-text")&&(p+=a(u[f+1]),u.splice(f+1,1)),0<f&&(typeof u[f-1]=="string"||u[f-1].type==="plain-text")&&(p=a(u[f-1])+p,u.splice(f-1,1),f--),u[f]=new e.Token("plain-text",p,null,p)),h.content&&typeof h.content!="string"&&s(h.content)}}var a=function(u){return u?typeof u=="string"?u:typeof u.content=="string"?u.content:u.content.map(a).join(""):""};e.hooks.add("after-tokenize",function(u){u.language!=="jsx"&&u.language!=="tsx"||s(u.tokens)})}(me),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0}(me),me.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},me.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=me.languages.swift}),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(me),me.languages.c=me.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),me.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),me.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},me.languages.c.string],char:me.languages.c.char,comment:me.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:me.languages.c}}}}),me.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete me.languages.c.boolean,me.languages.objectivec=me.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete me.languages.objectivec["class-name"],me.languages.objc=me.languages.objectivec,me.languages.reason=me.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),me.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete me.languages.reason.function,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(me),me.languages.go=me.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),me.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete me.languages.go["class-name"],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(me),me.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},me.languages.python["string-interpolation"].inside.interpolation.inside.rest=me.languages.python,me.languages.py=me.languages.python,me.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},me.languages.webmanifest=me.languages.json;var x4={};bue(x4,{dracula:()=>_ue,duotoneDark:()=>Tue,duotoneLight:()=>Pue,github:()=>Mue,gruvboxMaterialDark:()=>ace,gruvboxMaterialLight:()=>uce,jettwaveDark:()=>Jue,jettwaveLight:()=>tce,nightOwl:()=>Oue,nightOwlLight:()=>jue,oceanicNext:()=>Fue,okaidia:()=>$ue,oneDark:()=>rce,oneLight:()=>oce,palenight:()=>Vue,shadesOfPurple:()=>Uue,synthwave84:()=>Yue,ultramin:()=>Gue,vsDark:()=>w4,vsLight:()=>Xue});var Cue={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},_ue=Cue,Nue={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},Tue=Nue,Aue={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},Pue=Aue,Rue={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},Mue=Rue,Due={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},Oue=Due,Iue={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},jue=Iue,xr={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",punctuation:"#5FB3B3",tag:"#fc929e",function:"#79b6f2",className:"#FAC863",method:"#6699CC",operator:"#fc929e"},Lue={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:xr.keyword}},{types:["attr-value"],style:{color:xr.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:xr.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:xr.primitive}},{types:["boolean"],style:{color:xr.boolean}},{types:["tag"],style:{color:xr.tag}},{types:["string"],style:{color:xr.string}},{types:["punctuation"],style:{color:xr.string}},{types:["selector","char","builtin","inserted"],style:{color:xr.char}},{types:["function"],style:{color:xr.function}},{types:["operator","entity","url","variable"],style:{color:xr.variable}},{types:["keyword"],style:{color:xr.keyword}},{types:["atrule","class-name"],style:{color:xr.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},Fue=Lue,zue={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},$ue=zue,Bue={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},Vue=Bue,Wue={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},Uue=Wue,Hue={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},Yue=Hue,que={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},Gue=que,Zue={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},w4=Zue,Kue={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},Xue=Kue,Que={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},Jue=Que,ece={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},tce=ece,nce={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},rce=nce,ice={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},oce=ice,sce={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},ace=sce,lce={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},uce=lce,cce=e=>S.useCallback(t=>{var n=t,{className:r,style:i,line:o}=n,s=v4(n,["className","style","line"]);const a=Ym(Ii({},s),{className:rm("token-line",r)});return typeof e=="object"&&"plain"in e&&(a.style=e.plain),typeof i=="object"&&(a.style=Ii(Ii({},a.style||{}),i)),a},[e]),dce=e=>{const t=S.useCallback(({types:n,empty:r})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return e[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(i=>e[i]))}},[e]);return S.useCallback(n=>{var r=n,{token:i,className:o,style:s}=r,a=v4(r,["token","className","style"]);const u=Ym(Ii({},a),{className:rm("token",...i.types,o),children:i.content,style:t(i)});return s!=null&&(u.style=Ii(Ii({},u.style||{}),s)),u},[t])},fce=/\r\n|\r|\n/,WT=e=>{e.length===0?e.push({types:["plain"],content:`
355
+ `,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
356
+ `,e[0].empty=!0)},UT=(e,t)=>{const n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},hce=e=>{const t=[[]],n=[e],r=[0],i=[e.length];let o=0,s=0,a=[];const u=[a];for(;s>-1;){for(;(o=r[s]++)<i[s];){let c,f=t[s];const p=n[s][o];if(typeof p=="string"?(f=s>0?f:["plain"],c=p):(f=UT(f,p.type),p.alias&&(f=UT(f,p.alias)),c=p.content),typeof c!="string"){s++,t.push(f),n.push(c),r.push(0),i.push(c.length);continue}const m=c.split(fce),y=m.length;a.push({types:f,content:m[0]});for(let x=1;x<y;x++)WT(a),u.push(a=[]),a.push({types:f,content:m[x]})}s--,t.pop(),n.pop(),r.pop(),i.pop()}return WT(a),u},HT=hce,pce=({prism:e,code:t,grammar:n,language:r})=>S.useMemo(()=>{if(n==null)return HT([t]);const i={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run("before-tokenize",i),i.tokens=e.tokenize(t,n),e.hooks.run("after-tokenize",i),HT(i.tokens)},[t,n,r,e]),mce=(e,t)=>{const{plain:n}=e,r=e.styles.reduce((i,o)=>{const{languages:s,style:a}=o;return s&&!s.includes(t)||o.types.forEach(u=>{const c=Ii(Ii({},i[u]),a);i[u]=c}),i},{});return r.root=n,r.plain=Ym(Ii({},n),{backgroundColor:void 0}),r},gce=mce,yce=({children:e,language:t,code:n,theme:r,prism:i})=>{const o=t.toLowerCase(),s=gce(r,o),a=cce(s),u=dce(s),c=i.languages[o],f=pce({prism:i,language:o,code:n,grammar:c});return e({tokens:f,className:`prism-code language-${o}`,style:s!=null?s.root:{},getLineProps:a,getTokenProps:u})},vce=e=>S.createElement(yce,Ym(Ii({},e),{prism:e.prism||me,theme:e.theme||w4,code:e.code,language:e.language}));/*! Bundled license information:
357
+
358
+ prismjs/prism.js:
359
+ (**
360
+ * Prism: Lightweight, robust, elegant syntax highlighting
361
+ *
362
+ * @license MIT <https://opensource.org/licenses/MIT>
363
+ * @author Lea Verou <https://lea.verou.me>
364
+ * @namespace
365
+ * @public
366
+ *)
367
+ */const xce=(e,t)=>t.some(n=>{if(typeof n=="number")return e===n;const[r,i]=n.split(":").map(o=>parseInt(o));return r<=e&&e<=i}),wce=(e,t,n)=>n.some(([r,[i,o]])=>r===e&&i<=t&&t<=o),bce=(e,t)=>e.split(new RegExp(`(${t.map(([n])=>n).join("|")})`)).filter(Boolean),kce=e=>e.map(t=>{t=t.startsWith("/")?t:"/"+t;const[,n,r="0:Infinity"]=t.split("/"),[i,o=i]=r.split(":").map(s=>Number(s));return[n,[i,o]]}),b4=(e,t)=>()=>{const n=S.useContext(e);if(n===void 0)throw new Error(t);return n},qm=e=>Object.assign(S.forwardRef(e),{displayName:e.displayName??e.name}),k4=S.createContext(void 0),S4=S.createContext(void 0),E4=b4(k4,'Could not find nearest <CodeBlock /> component. Please wrap this component with a <CodeBlock /> component imported from "react-code-block".'),wk=b4(S4,'Could not find nearest <CodeBlock.Code /> component. Please wrap this component with <CodeBlock.Code /> component imported from "react-code-block".'),uo=({code:e,words:t=[],lines:n=[],children:r,...i})=>{const o=S.useMemo(()=>kce(t),[t]);return v.jsx(k4.Provider,{value:{code:e.trim(),words:o,lines:n,...i},children:r})},Sce=({as:e,children:t,...n},r)=>{const{lines:i,words:o,...s}=E4(),a=e??"pre";return v.jsx(vce,{...s,children:u=>v.jsx(a,{...n,ref:r,children:u.tokens.map((c,f)=>{const h=f+1,p=xce(h,i);return v.jsx(S4.Provider,{value:{highlight:u,line:c,lineNumber:h},children:typeof t=="function"?t({isLineHighlighted:p,lineNumber:h},f):t},f)})})})},Ece=({as:e,children:t,className:n,...r},i)=>{const{highlight:o,line:s}=wk(),{getLineProps:a}=o,u=e??"div";return v.jsx(u,{...a({line:s,className:n}),...r,ref:i,children:t})},Cce=({as:e,children:t=({children:o})=>v.jsx("span",{children:o}),className:n,...r},i)=>{const{words:o}=E4(),{line:s,highlight:a,lineNumber:u}=wk(),{getTokenProps:c}=a,f=e??"span";return v.jsx(ne.Fragment,{children:s.map((h,p)=>{const{children:m,...y}=c({token:h,className:n}),x=o.length?bce(m,o):[m];return v.jsx(ne.Fragment,{children:x.map((k,w)=>v.jsx(f,{...y,...r,ref:i,children:t({children:k,isTokenHighlighted:wce(k,u,o)})},w))},p)})})},_ce=({as:e,...t},n)=>{const{lineNumber:r}=wk(),i=e??"span";return v.jsx(i,{...t,ref:n,children:r})};uo.Code=qm(Sce);uo.LineContent=qm(Ece);uo.Token=qm(Cce);uo.LineNumber=qm(_ce);function bk({code:e="",language:t="ts",filename:n,className:r}){return v.jsxs(uo,{code:e,language:t,theme:x4.oneDark,children:[n?v.jsx("div",{className:"absolute w-full px-6 py-2 pl-4 text-sm rounded bg-mastra-bg-2 text-mastra-el-6/50",children:n}):null,v.jsx(uo.Code,{className:Te("bg-transparent h-full p-6 rounded-xl whitespace-pre-wrap",n?"pt-10":"",r),children:v.jsx("div",{className:"table-row",children:v.jsxs("div",{className:"flex items-center",children:[v.jsx(uo.LineNumber,{className:"table-cell pr-4 text-sm text-right select-none text-gray-500/50"}),v.jsx(uo.LineContent,{className:"flex",children:v.jsx(uo.Token,{className:"font-mono text-sm mastra-token"})})]})})})]})}const Nce=()=>{const[e,t]=S.useState(!1);return{executeTool:async({agentId:r,toolId:i,input:o})=>{try{t(!0);const s=await fetch(`/api/agents/${r}/tools/${i}/execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!s.ok)throw new Error(`Error executing tool: ${s.statusText}`);return await s.json()}catch(s){throw console.error("Error executing tool:",s),s}finally{t(!1)}},isExecutingTool:e}},Tce=()=>{const{toolId:e,agentId:t}=tm(),{executeTool:n,isExecutingTool:r}=Nce(),[i,o]=S.useState(null),{agent:s,isLoading:a}=im(t),u=Object.values((s==null?void 0:s.tools)??{}).find(p=>p.id===e),c=async p=>{if(!s||!u)return;const m=await n({agentId:t,toolId:u.id,input:p});o(m)};if(a)return v.jsxs("div",{className:"flex flex-col h-full w-full bg-mastra-bg-1",children:[v.jsx(Er,{title:"Loading..."}),v.jsxs("div",{className:"w-full h-full grid grid-cols-[300px_1fr] p-2 gap-2",children:[v.jsxs("div",{className:"flex flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Input"}),v.jsx(Je,{className:"h-[200px] w-full"})]}),v.jsxs("div",{className:"flex flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Output"}),v.jsx(Je,{className:"h-[200px] w-full"})]})]})]});if(!s||!u)return null;const f=u!=null&&u.inputSchema?uk(tk(nk(u==null?void 0:u.inputSchema))):Qt.object({}),h=[{label:"Agents",href:"/agents"},{label:t,href:`/agents/${t}`},{label:e,href:`/agents/${t}/tools/${e}`,isCurrent:!0}];return v.jsxs("div",{className:"flex flex-col h-full w-full bg-mastra-bg-1",children:[v.jsx(Er,{title:v.jsx(km,{items:h})}),v.jsxs("div",{className:"w-full h-full grid grid-cols-[1fr_2fr] p-2 gap-2",children:[v.jsxs("div",{className:"flex flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Input"}),v.jsx(vk,{isSubmitLoading:r,schema:f,onSubmit:p=>{c(p)}})]}),v.jsxs("div",{className:"flex relative group flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Output"}),v.jsx("div",{className:"flex flex-col gap-2",children:v.jsx(um,{classname:"absolute z-40 top-4 right-4 w-8 h-8 p-0 opacity-0 group-hover:opacity-100 transition-opacity duration-150 ease-in-out",content:JSON.stringify(i??{},null,2)})}),v.jsx(bk,{code:JSON.stringify(i??{},null,2),language:"json"})]})]})]})},Ace=()=>{const[e,t]=S.useState(!1);return{executeTool:async({toolId:r,input:i})=>{try{t(!0);const o=await fetch(`/api/tools/${r}/execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:i})});if(!o.ok){const s=await o.json();throw mn.error((s==null?void 0:s.error)||"Error executing dev tool"),new Error(`Error executing dev tool: ${(s==null?void 0:s.error)||o.statusText}`)}return await o.json()}catch(o){throw console.error("Error executing dev tool:",o),o}finally{t(!1)}},isExecuting:e}},Pce=()=>{const{toolId:e}=tm(),{executeTool:t,isExecuting:n}=Ace(),[r,i]=S.useState(null),{tool:o,isLoading:s}=h6(e),a=async f=>{if(!o)return;const h=await t({toolId:o.id,input:f});i(h)};if(s)return v.jsxs("div",{className:"flex flex-col h-full w-full bg-mastra-bg-1",children:[v.jsx(Er,{title:"Loading..."}),v.jsxs("div",{className:"w-full h-full grid grid-cols-[300px_1fr] p-2 gap-2",children:[v.jsxs("div",{className:"flex flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Input"}),v.jsx(Je,{className:"h-[200px] w-full"})]}),v.jsxs("div",{className:"flex flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Output"}),v.jsx(Je,{className:"h-[200px] w-full"})]})]})]});if(!o)return null;const u=o!=null&&o.inputSchema?uk(tk(nk(o==null?void 0:o.inputSchema))):Qt.object({}),c=[{label:"Tools",href:"/tools"},{label:e,href:`/tools/all/${o.id}`,isCurrent:!0}];return v.jsxs("div",{className:"flex flex-col h-full w-full bg-mastra-bg-1",children:[v.jsx(Er,{title:v.jsx(km,{items:c})}),v.jsxs("div",{className:"w-full h-full grid grid-cols-[300px_1fr] p-2 gap-2",children:[v.jsxs("div",{className:"flex flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Input"}),v.jsx(vk,{isSubmitLoading:n,schema:u,onSubmit:f=>{a(f)},submitButtonLabel:"Run"})]}),v.jsxs("div",{className:"flex relative group flex-col gap-4 border-[0.5px] border-mastra-border-1 rounded-[0.25rem] bg-mastra-bg-2 p-4 py-6",children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Output"}),v.jsx("div",{className:"flex flex-col gap-2",children:v.jsx(um,{classname:"absolute z-40 top-4 right-4 w-8 h-8 p-0 opacity-0 group-hover:opacity-100 transition-opacity duration-150 ease-in-out",content:JSON.stringify(r??{},null,2)})}),v.jsx(bk,{code:JSON.stringify(r??{},null,2),language:"json"})]})]})]})},Rce=()=>{const[e,t]=S.useState({}),[n,r]=S.useState(!0);return S.useEffect(()=>{(async()=>{r(!0);try{const o=await fetch("/api/workflows");if(!o.ok){const a=await o.json();t({}),console.error("Error fetching workflows",a),mn.error((a==null?void 0:a.error)||"Error fetching workflows");return}const s=await o.json();t(s)}catch(o){t({}),console.error("Error fetching workflows",o),mn.error("Error fetching workflows")}finally{r(!1)}})()},[]),{workflows:e,isLoading:n}},C4=e=>{const[t,n]=S.useState(null),[r,i]=S.useState(!0);return S.useEffect(()=>{(async()=>{i(!0);try{if(!e){n(null),i(!1);return}const s=await fetch(`/api/workflows/${e}`);if(!s.ok){const u=await s.json();n(null),console.error("Error fetching workflow",u),mn.error((u==null?void 0:u.error)||"Error fetching workflow");return}const a=await s.json();n(a)}catch(s){n(null),console.error("Error fetching workflow",s),mn.error("Error fetching workflow")}finally{i(!1)}})()},[e]),{workflow:t,isLoading:r}},Mce=()=>{const[e,t]=S.useState(!1);return{executeWorkflow:async({workflowId:r,input:i})=>{try{t(!0);const o=await fetch(`/api/workflows/${r}/execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!o.ok){const s=await o.json();mn.error((s==null?void 0:s.error)||"Error executing workflow");return}return await o.json()}catch(o){throw console.error("Error executing workflow:",o),o}finally{t(!1)}},isExecutingWorkflow:e}};function Dce(){const{workflows:e,isLoading:t}=Rce(),n=ks();return v.jsxs("div",{className:"flex flex-col h-full relative overflow-hidden",children:[v.jsx(Er,{title:"Workflows"}),v.jsx("main",{className:"flex-1 relative overflow-hidden",children:v.jsx(fr,{className:"rounded-lg h-full",children:v.jsxs(wb,{children:[v.jsx(bb,{className:"bg-[#171717] sticky top-0 z-10",children:v.jsxs(ea,{className:"border-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[v.jsx(ao,{className:"w-[50px]"}),v.jsx(ao,{className:"text-mastra-el-3 w-1/2",children:"Name"}),v.jsx(ao,{className:"text-mastra-el-3",children:"Action"})]})}),v.jsx(kb,{className:"border-b border-gray-6",children:t?v.jsxs(ea,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[v.jsx(Bn,{children:v.jsx(Je,{className:"h-8 w-8"})}),v.jsx(Bn,{children:v.jsx(Je,{className:"h-8 w-full"})}),v.jsx(Bn,{children:v.jsx(Je,{className:"h-8 w-full"})})]}):Object.entries(e).map(([r,i])=>v.jsxs(ea,{className:"border-b-gray-6 border-b-[0.1px] text-[0.8125rem]",children:[v.jsx(Bn,{children:v.jsx("div",{className:"h-8 w-full flex items-center justify-center",children:v.jsx(T0,{className:"h-4 w-4 text-mastra-el-5"})})}),v.jsx(Bn,{className:"font-medium truncate max-w-[500px] text-mastra-el-5",children:i.name}),v.jsx(Bn,{className:"text-mastra-el-5 text-sm",children:v.jsx("span",{onClick:()=>{n(`/workflows/${r}`)},className:"hover:no-underline",children:v.jsxs(Bt,{size:"sm",variant:"outline",children:[v.jsx(T0,{className:"h-4 w-4 text-inherit"}),"View Workflow"]})})})]},r))})]})})})]})}function gn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=gn(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Oce={value:()=>{}};function Gm(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new tp(n)}function tp(e){this._=e}function Ice(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}tp.prototype=Gm.prototype={constructor:tp,on:function(e,t){var n=this._,r=Ice(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=jce(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=YT(n[i],e.name,t);else if(t==null)for(i in n)n[i]=YT(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new tp(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function jce(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function YT(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Oce,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Vw="http://www.w3.org/1999/xhtml";const qT={svg:"http://www.w3.org/2000/svg",xhtml:Vw,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Zm(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),qT.hasOwnProperty(t)?{space:qT[t],local:e}:e}function Lce(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Vw&&t.documentElement.namespaceURI===Vw?t.createElement(e):t.createElementNS(n,e)}}function Fce(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function _4(e){var t=Zm(e);return(t.local?Fce:Lce)(t)}function zce(){}function kk(e){return e==null?zce:function(){return this.querySelector(e)}}function $ce(e){typeof e!="function"&&(e=kk(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=new Array(s),u,c,f=0;f<s;++f)(u=o[f])&&(c=e.call(u,u.__data__,f,o))&&("__data__"in u&&(c.__data__=u.__data__),a[f]=c);return new Rr(r,this._parents)}function Bce(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Vce(){return[]}function N4(e){return e==null?Vce:function(){return this.querySelectorAll(e)}}function Wce(e){return function(){return Bce(e.apply(this,arguments))}}function Uce(e){typeof e=="function"?e=Wce(e):e=N4(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],a=s.length,u,c=0;c<a;++c)(u=s[c])&&(r.push(e.call(u,u.__data__,c,s)),i.push(u));return new Rr(r,i)}function T4(e){return function(){return this.matches(e)}}function A4(e){return function(t){return t.matches(e)}}var Hce=Array.prototype.find;function Yce(e){return function(){return Hce.call(this.children,e)}}function qce(){return this.firstElementChild}function Gce(e){return this.select(e==null?qce:Yce(typeof e=="function"?e:A4(e)))}var Zce=Array.prototype.filter;function Kce(){return Array.from(this.children)}function Xce(e){return function(){return Zce.call(this.children,e)}}function Qce(e){return this.selectAll(e==null?Kce:Xce(typeof e=="function"?e:A4(e)))}function Jce(e){typeof e!="function"&&(e=T4(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],u,c=0;c<s;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&a.push(u);return new Rr(r,this._parents)}function P4(e){return new Array(e.length)}function ede(){return new Rr(this._enter||this._groups.map(P4),this._parents)}function Up(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Up.prototype={constructor:Up,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function tde(e){return function(){return e}}function nde(e,t,n,r,i,o){for(var s=0,a,u=t.length,c=o.length;s<c;++s)(a=t[s])?(a.__data__=o[s],r[s]=a):n[s]=new Up(e,o[s]);for(;s<u;++s)(a=t[s])&&(i[s]=a)}function rde(e,t,n,r,i,o,s){var a,u,c=new Map,f=t.length,h=o.length,p=new Array(f),m;for(a=0;a<f;++a)(u=t[a])&&(p[a]=m=s.call(u,u.__data__,a,t)+"",c.has(m)?i[a]=u:c.set(m,u));for(a=0;a<h;++a)m=s.call(e,o[a],a,o)+"",(u=c.get(m))?(r[a]=u,u.__data__=o[a],c.delete(m)):n[a]=new Up(e,o[a]);for(a=0;a<f;++a)(u=t[a])&&c.get(p[a])===u&&(i[a]=u)}function ide(e){return e.__data__}function ode(e,t){if(!arguments.length)return Array.from(this,ide);var n=t?rde:nde,r=this._parents,i=this._groups;typeof e!="function"&&(e=tde(e));for(var o=i.length,s=new Array(o),a=new Array(o),u=new Array(o),c=0;c<o;++c){var f=r[c],h=i[c],p=h.length,m=sde(e.call(f,f&&f.__data__,c,r)),y=m.length,x=a[c]=new Array(y),k=s[c]=new Array(y),w=u[c]=new Array(p);n(f,h,x,k,w,m,t);for(var E=0,C=0,N,P;E<y;++E)if(N=x[E]){for(E>=C&&(C=E+1);!(P=k[C])&&++C<y;);N._next=P||null}}return s=new Rr(s,r),s._enter=a,s._exit=u,s}function sde(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ade(){return new Rr(this._exit||this._groups.map(P4),this._parents)}function lde(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function ude(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),u=0;u<s;++u)for(var c=n[u],f=r[u],h=c.length,p=a[u]=new Array(h),m,y=0;y<h;++y)(m=c[y]||f[y])&&(p[y]=m);for(;u<i;++u)a[u]=n[u];return new Rr(a,this._parents)}function cde(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function dde(e){e||(e=fde);function t(h,p){return h&&p?e(h.__data__,p.__data__):!h-!p}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,u=i[o]=new Array(a),c,f=0;f<a;++f)(c=s[f])&&(u[f]=c);u.sort(t)}return new Rr(i,this._parents).order()}function fde(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function hde(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function pde(){return Array.from(this)}function mde(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function gde(){let e=0;for(const t of this)++e;return e}function yde(){return!this.node()}function vde(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&e.call(a,a.__data__,o,i);return this}function xde(e){return function(){this.removeAttribute(e)}}function wde(e){return function(){this.removeAttributeNS(e.space,e.local)}}function bde(e,t){return function(){this.setAttribute(e,t)}}function kde(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Sde(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ede(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Cde(e,t){var n=Zm(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?wde:xde:typeof t=="function"?n.local?Ede:Sde:n.local?kde:bde)(n,t))}function R4(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function _de(e){return function(){this.style.removeProperty(e)}}function Nde(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Tde(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Ade(e,t,n){return arguments.length>1?this.each((t==null?_de:typeof t=="function"?Tde:Nde)(e,t,n??"")):Wl(this.node(),e)}function Wl(e,t){return e.style.getPropertyValue(t)||R4(e).getComputedStyle(e,null).getPropertyValue(t)}function Pde(e){return function(){delete this[e]}}function Rde(e,t){return function(){this[e]=t}}function Mde(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Dde(e,t){return arguments.length>1?this.each((t==null?Pde:typeof t=="function"?Mde:Rde)(e,t)):this.node()[e]}function M4(e){return e.trim().split(/^|\s+/)}function Sk(e){return e.classList||new D4(e)}function D4(e){this._node=e,this._names=M4(e.getAttribute("class")||"")}D4.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function O4(e,t){for(var n=Sk(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function I4(e,t){for(var n=Sk(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Ode(e){return function(){O4(this,e)}}function Ide(e){return function(){I4(this,e)}}function jde(e,t){return function(){(t.apply(this,arguments)?O4:I4)(this,e)}}function Lde(e,t){var n=M4(e+"");if(arguments.length<2){for(var r=Sk(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?jde:t?Ode:Ide)(n,t))}function Fde(){this.textContent=""}function zde(e){return function(){this.textContent=e}}function $de(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Bde(e){return arguments.length?this.each(e==null?Fde:(typeof e=="function"?$de:zde)(e)):this.node().textContent}function Vde(){this.innerHTML=""}function Wde(e){return function(){this.innerHTML=e}}function Ude(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Hde(e){return arguments.length?this.each(e==null?Vde:(typeof e=="function"?Ude:Wde)(e)):this.node().innerHTML}function Yde(){this.nextSibling&&this.parentNode.appendChild(this)}function qde(){return this.each(Yde)}function Gde(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Zde(){return this.each(Gde)}function Kde(e){var t=typeof e=="function"?e:_4(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Xde(){return null}function Qde(e,t){var n=typeof e=="function"?e:_4(e),r=t==null?Xde:typeof t=="function"?t:kk(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Jde(){var e=this.parentNode;e&&e.removeChild(this)}function efe(){return this.each(Jde)}function tfe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nfe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rfe(e){return this.select(e?nfe:tfe)}function ife(e){return arguments.length?this.property("__data__",e):this.node().__data__}function ofe(e){return function(t){e.call(this,t,this.__data__)}}function sfe(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function afe(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function lfe(e,t,n){return function(){var r=this.__on,i,o=ofe(t);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function ufe(e,t,n){var r=sfe(e+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var u=0,c=a.length,f;u<c;++u)for(i=0,f=a[u];i<o;++i)if((s=r[i]).type===f.type&&s.name===f.name)return f.value}return}for(a=t?lfe:afe,i=0;i<o;++i)this.each(a(r[i],t,n));return this}function j4(e,t,n){var r=R4(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function cfe(e,t){return function(){return j4(this,e,t)}}function dfe(e,t){return function(){return j4(this,e,t.apply(this,arguments))}}function ffe(e,t){return this.each((typeof t=="function"?dfe:cfe)(e,t))}function*hfe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var L4=[null];function Rr(e,t){this._groups=e,this._parents=t}function Qd(){return new Rr([[document.documentElement]],L4)}function pfe(){return this}Rr.prototype=Qd.prototype={constructor:Rr,select:$ce,selectAll:Uce,selectChild:Gce,selectChildren:Qce,filter:Jce,data:ode,enter:ede,exit:ade,join:lde,merge:ude,selection:pfe,order:cde,sort:dde,call:hde,nodes:pde,node:mde,size:gde,empty:yde,each:vde,attr:Cde,style:Ade,property:Dde,classed:Lde,text:Bde,html:Hde,raise:qde,lower:Zde,append:Kde,insert:Qde,remove:efe,clone:rfe,datum:ife,on:ufe,dispatch:ffe,[Symbol.iterator]:hfe};function Sr(e){return typeof e=="string"?new Rr([[document.querySelector(e)]],[document.documentElement]):new Rr([[e]],L4)}function mfe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ii(e,t){if(e=mfe(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const gfe={passive:!1},dd={capture:!0,passive:!1};function wx(e){e.stopImmediatePropagation()}function _l(e){e.preventDefault(),e.stopImmediatePropagation()}function F4(e){var t=e.document.documentElement,n=Sr(e).on("dragstart.drag",_l,dd);"onselectstart"in t?n.on("selectstart.drag",_l,dd):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function z4(e,t){var n=e.document.documentElement,r=Sr(e).on("dragstart.drag",null);t&&(r.on("click.drag",_l,dd),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Dh=e=>()=>e;function Ww(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:u,dy:c,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:f}})}Ww.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function yfe(e){return!e.ctrlKey&&!e.button}function vfe(){return this.parentNode}function xfe(e,t){return t??{x:e.x,y:e.y}}function wfe(){return navigator.maxTouchPoints||"ontouchstart"in this}function $4(){var e=yfe,t=vfe,n=xfe,r=wfe,i={},o=Gm("start","drag","end"),s=0,a,u,c,f,h=0;function p(N){N.on("mousedown.drag",m).filter(r).on("touchstart.drag",k).on("touchmove.drag",w,gfe).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(N,P){if(!(f||!e.call(this,N,P))){var A=C(this,t.call(this,N,P),N,P,"mouse");A&&(Sr(N.view).on("mousemove.drag",y,dd).on("mouseup.drag",x,dd),F4(N.view),wx(N),c=!1,a=N.clientX,u=N.clientY,A("start",N))}}function y(N){if(_l(N),!c){var P=N.clientX-a,A=N.clientY-u;c=P*P+A*A>h}i.mouse("drag",N)}function x(N){Sr(N.view).on("mousemove.drag mouseup.drag",null),z4(N.view,c),_l(N),i.mouse("end",N)}function k(N,P){if(e.call(this,N,P)){var A=N.changedTouches,O=t.call(this,N,P),M=A.length,j,R;for(j=0;j<M;++j)(R=C(this,O,N,P,A[j].identifier,A[j]))&&(wx(N),R("start",N,A[j]))}}function w(N){var P=N.changedTouches,A=P.length,O,M;for(O=0;O<A;++O)(M=i[P[O].identifier])&&(_l(N),M("drag",N,P[O]))}function E(N){var P=N.changedTouches,A=P.length,O,M;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),O=0;O<A;++O)(M=i[P[O].identifier])&&(wx(N),M("end",N,P[O]))}function C(N,P,A,O,M,j){var R=o.copy(),$=ii(j||A,P),F,H,I;if((I=n.call(N,new Ww("beforestart",{sourceEvent:A,target:p,identifier:M,active:s,x:$[0],y:$[1],dx:0,dy:0,dispatch:R}),O))!=null)return F=I.x-$[0]||0,H=I.y-$[1]||0,function Y(q,Z,B){var W=$,L;switch(q){case"start":i[M]=Y,L=s++;break;case"end":delete i[M],--s;case"drag":$=ii(B||Z,P),L=s;break}R.call(q,N,new Ww(q,{sourceEvent:Z,subject:I,target:p,identifier:M,active:L,x:$[0]+F,y:$[1]+H,dx:$[0]-W[0],dy:$[1]-W[1],dispatch:R}),O)}}return p.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Dh(!!N),p):e},p.container=function(N){return arguments.length?(t=typeof N=="function"?N:Dh(N),p):t},p.subject=function(N){return arguments.length?(n=typeof N=="function"?N:Dh(N),p):n},p.touchable=function(N){return arguments.length?(r=typeof N=="function"?N:Dh(!!N),p):r},p.on=function(){var N=o.on.apply(o,arguments);return N===o?p:N},p.clickDistance=function(N){return arguments.length?(h=(N=+N)*N,p):Math.sqrt(h)},p}function Ek(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function B4(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Jd(){}var fd=.7,Hp=1/fd,Nl="\\s*([+-]?\\d+)\\s*",hd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bfe=/^#([0-9a-f]{3,8})$/,kfe=new RegExp(`^rgb\\(${Nl},${Nl},${Nl}\\)$`),Sfe=new RegExp(`^rgb\\(${ji},${ji},${ji}\\)$`),Efe=new RegExp(`^rgba\\(${Nl},${Nl},${Nl},${hd}\\)$`),Cfe=new RegExp(`^rgba\\(${ji},${ji},${ji},${hd}\\)$`),_fe=new RegExp(`^hsl\\(${hd},${ji},${ji}\\)$`),Nfe=new RegExp(`^hsla\\(${hd},${ji},${ji},${hd}\\)$`),GT={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ek(Jd,pd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ZT,formatHex:ZT,formatHex8:Tfe,formatHsl:Afe,formatRgb:KT,toString:KT});function ZT(){return this.rgb().formatHex()}function Tfe(){return this.rgb().formatHex8()}function Afe(){return V4(this).formatHsl()}function KT(){return this.rgb().formatRgb()}function pd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=bfe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?XT(t):n===3?new dr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Oh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Oh(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=kfe.exec(e))?new dr(t[1],t[2],t[3],1):(t=Sfe.exec(e))?new dr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Efe.exec(e))?Oh(t[1],t[2],t[3],t[4]):(t=Cfe.exec(e))?Oh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_fe.exec(e))?eA(t[1],t[2]/100,t[3]/100,1):(t=Nfe.exec(e))?eA(t[1],t[2]/100,t[3]/100,t[4]):GT.hasOwnProperty(e)?XT(GT[e]):e==="transparent"?new dr(NaN,NaN,NaN,0):null}function XT(e){return new dr(e>>16&255,e>>8&255,e&255,1)}function Oh(e,t,n,r){return r<=0&&(e=t=n=NaN),new dr(e,t,n,r)}function Pfe(e){return e instanceof Jd||(e=pd(e)),e?(e=e.rgb(),new dr(e.r,e.g,e.b,e.opacity)):new dr}function Uw(e,t,n,r){return arguments.length===1?Pfe(e):new dr(e,t,n,r??1)}function dr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ek(dr,Uw,B4(Jd,{brighter(e){return e=e==null?Hp:Math.pow(Hp,e),new dr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?fd:Math.pow(fd,e),new dr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dr(oa(this.r),oa(this.g),oa(this.b),Yp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QT,formatHex:QT,formatHex8:Rfe,formatRgb:JT,toString:JT}));function QT(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}`}function Rfe(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}${Js((isNaN(this.opacity)?1:this.opacity)*255)}`}function JT(){const e=Yp(this.opacity);return`${e===1?"rgb(":"rgba("}${oa(this.r)}, ${oa(this.g)}, ${oa(this.b)}${e===1?")":`, ${e})`}`}function Yp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function oa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Js(e){return e=oa(e),(e<16?"0":"")+e.toString(16)}function eA(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new oi(e,t,n,r)}function V4(e){if(e instanceof oi)return new oi(e.h,e.s,e.l,e.opacity);if(e instanceof Jd||(e=pd(e)),!e)return new oi;if(e instanceof oi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,u=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=u<.5?o+i:2-o-i,s*=60):a=u>0&&u<1?0:s,new oi(s,a,u,e.opacity)}function Mfe(e,t,n,r){return arguments.length===1?V4(e):new oi(e,t,n,r??1)}function oi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ek(oi,Mfe,B4(Jd,{brighter(e){return e=e==null?Hp:Math.pow(Hp,e),new oi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?fd:Math.pow(fd,e),new oi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new dr(bx(e>=240?e-240:e+120,i,r),bx(e,i,r),bx(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new oi(tA(this.h),Ih(this.s),Ih(this.l),Yp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Yp(this.opacity);return`${e===1?"hsl(":"hsla("}${tA(this.h)}, ${Ih(this.s)*100}%, ${Ih(this.l)*100}%${e===1?")":`, ${e})`}`}}));function tA(e){return e=(e||0)%360,e<0?e+360:e}function Ih(e){return Math.max(0,Math.min(1,e||0))}function bx(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const W4=e=>()=>e;function Dfe(e,t){return function(n){return e+n*t}}function Ofe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Ife(e){return(e=+e)==1?U4:function(t,n){return n-t?Ofe(t,n,e):W4(isNaN(t)?n:t)}}function U4(e,t){var n=t-e;return n?Dfe(e,n):W4(isNaN(e)?t:e)}const nA=function e(t){var n=Ife(t);function r(i,o){var s=n((i=Uw(i)).r,(o=Uw(o)).r),a=n(i.g,o.g),u=n(i.b,o.b),c=U4(i.opacity,o.opacity);return function(f){return i.r=s(f),i.g=a(f),i.b=u(f),i.opacity=c(f),i+""}}return r.gamma=e,r}(1);function ss(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Hw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kx=new RegExp(Hw.source,"g");function jfe(e){return function(){return e}}function Lfe(e){return function(t){return e(t)+""}}function Ffe(e,t){var n=Hw.lastIndex=kx.lastIndex=0,r,i,o,s=-1,a=[],u=[];for(e=e+"",t=t+"";(r=Hw.exec(e))&&(i=kx.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,u.push({i:s,x:ss(r,i)})),n=kx.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?u[0]?Lfe(u[0].x):jfe(t):(t=u.length,function(c){for(var f=0,h;f<t;++f)a[(h=u[f]).i]=h.x(c);return a.join("")})}var rA=180/Math.PI,Yw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function H4(e,t,n,r,i,o){var s,a,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,u/=a),e*r<t*n&&(e=-e,t=-t,u=-u,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*rA,skewX:Math.atan(u)*rA,scaleX:s,scaleY:a}}var jh;function zfe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Yw:H4(t.a,t.b,t.c,t.d,t.e,t.f)}function $fe(e){return e==null||(jh||(jh=document.createElementNS("http://www.w3.org/2000/svg","g")),jh.setAttribute("transform",e),!(e=jh.transform.baseVal.consolidate()))?Yw:(e=e.matrix,H4(e.a,e.b,e.c,e.d,e.e,e.f))}function Y4(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function o(c,f,h,p,m,y){if(c!==h||f!==p){var x=m.push("translate(",null,t,null,n);y.push({i:x-4,x:ss(c,h)},{i:x-2,x:ss(f,p)})}else(h||p)&&m.push("translate("+h+t+p+n)}function s(c,f,h,p){c!==f?(c-f>180?f+=360:f-c>180&&(c+=360),p.push({i:h.push(i(h)+"rotate(",null,r)-2,x:ss(c,f)})):f&&h.push(i(h)+"rotate("+f+r)}function a(c,f,h,p){c!==f?p.push({i:h.push(i(h)+"skewX(",null,r)-2,x:ss(c,f)}):f&&h.push(i(h)+"skewX("+f+r)}function u(c,f,h,p,m,y){if(c!==h||f!==p){var x=m.push(i(m)+"scale(",null,",",null,")");y.push({i:x-4,x:ss(c,h)},{i:x-2,x:ss(f,p)})}else(h!==1||p!==1)&&m.push(i(m)+"scale("+h+","+p+")")}return function(c,f){var h=[],p=[];return c=e(c),f=e(f),o(c.translateX,c.translateY,f.translateX,f.translateY,h,p),s(c.rotate,f.rotate,h,p),a(c.skewX,f.skewX,h,p),u(c.scaleX,c.scaleY,f.scaleX,f.scaleY,h,p),c=f=null,function(m){for(var y=-1,x=p.length,k;++y<x;)h[(k=p[y]).i]=k.x(m);return h.join("")}}}var Bfe=Y4(zfe,"px, ","px)","deg)"),Vfe=Y4($fe,", ",")",")"),Wfe=1e-12;function iA(e){return((e=Math.exp(e))+1/e)/2}function Ufe(e){return((e=Math.exp(e))-1/e)/2}function Hfe(e){return((e=Math.exp(2*e))-1)/(e+1)}const Yfe=function e(t,n,r){function i(o,s){var a=o[0],u=o[1],c=o[2],f=s[0],h=s[1],p=s[2],m=f-a,y=h-u,x=m*m+y*y,k,w;if(x<Wfe)w=Math.log(p/c)/t,k=function(O){return[a+O*m,u+O*y,c*Math.exp(t*O*w)]};else{var E=Math.sqrt(x),C=(p*p-c*c+r*x)/(2*c*n*E),N=(p*p-c*c-r*x)/(2*p*n*E),P=Math.log(Math.sqrt(C*C+1)-C),A=Math.log(Math.sqrt(N*N+1)-N);w=(A-P)/t,k=function(O){var M=O*w,j=iA(P),R=c/(n*E)*(j*Hfe(t*M+P)-Ufe(P));return[a+R*m,u+R*y,c*j/iA(t*M+P)]}}return k.duration=w*1e3*t/Math.SQRT2,k}return i.rho=function(o){var s=Math.max(.001,+o),a=s*s,u=a*a;return e(s,a,u)},i}(Math.SQRT2,2,4);var Ul=0,wc=0,uc=0,q4=1e3,qp,bc,Gp=0,ga=0,Km=0,md=typeof performance=="object"&&performance.now?performance:Date,G4=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ck(){return ga||(G4(qfe),ga=md.now()+Km)}function qfe(){ga=0}function Zp(){this._call=this._time=this._next=null}Zp.prototype=Z4.prototype={constructor:Zp,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ck():+n)+(t==null?0:+t),!this._next&&bc!==this&&(bc?bc._next=this:qp=this,bc=this),this._call=e,this._time=n,qw()},stop:function(){this._call&&(this._call=null,this._time=1/0,qw())}};function Z4(e,t,n){var r=new Zp;return r.restart(e,t,n),r}function Gfe(){Ck(),++Ul;for(var e=qp,t;e;)(t=ga-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ul}function oA(){ga=(Gp=md.now())+Km,Ul=wc=0;try{Gfe()}finally{Ul=0,Kfe(),ga=0}}function Zfe(){var e=md.now(),t=e-Gp;t>q4&&(Km-=t,Gp=e)}function Kfe(){for(var e,t=qp,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:qp=n);bc=e,qw(r)}function qw(e){if(!Ul){wc&&(wc=clearTimeout(wc));var t=e-ga;t>24?(e<1/0&&(wc=setTimeout(oA,e-md.now()-Km)),uc&&(uc=clearInterval(uc))):(uc||(Gp=md.now(),uc=setInterval(Zfe,q4)),Ul=1,G4(oA))}}function sA(e,t,n){var r=new Zp;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Xfe=Gm("start","end","cancel","interrupt"),Qfe=[],K4=0,aA=1,Gw=2,np=3,lA=4,Zw=5,rp=6;function Xm(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Jfe(e,n,{name:t,index:r,group:i,on:Xfe,tween:Qfe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:K4})}function _k(e,t){var n=yi(e,t);if(n.state>K4)throw new Error("too late; already scheduled");return n}function Hi(e,t){var n=yi(e,t);if(n.state>np)throw new Error("too late; already running");return n}function yi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Jfe(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Z4(o,0,n.time);function o(c){n.state=aA,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var f,h,p,m;if(n.state!==aA)return u();for(f in r)if(m=r[f],m.name===n.name){if(m.state===np)return sA(s);m.state===lA?(m.state=rp,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[f]):+f<t&&(m.state=rp,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete r[f])}if(sA(function(){n.state===np&&(n.state=lA,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Gw,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Gw){for(n.state=np,i=new Array(p=n.tween.length),f=0,h=-1;f<p;++f)(m=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=m);i.length=h+1}}function a(c){for(var f=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=Zw,1),h=-1,p=i.length;++h<p;)i[h].call(e,f);n.state===Zw&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=rp,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function ip(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>Gw&&r.state<Zw,r.state=rp,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function ehe(e){return this.each(function(){ip(this,e)})}function the(e,t){var n,r;return function(){var i=Hi(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function nhe(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Hi(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:t,value:n},u=0,c=i.length;u<c;++u)if(i[u].name===t){i[u]=a;break}u===c&&i.push(a)}o.tween=i}}function rhe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=yi(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?the:nhe)(n,e,t))}function Nk(e,t,n){var r=e._id;return e.each(function(){var i=Hi(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return yi(i,r).value[t]}}function X4(e,t){var n;return(typeof t=="number"?ss:t instanceof pd?nA:(n=pd(t))?(t=n,nA):Ffe)(e,t)}function ihe(e){return function(){this.removeAttribute(e)}}function ohe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function she(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===r?o:o=t(r=s,n)}}function ahe(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?o:o=t(r=s,n)}}function lhe(e,t,n){var r,i,o;return function(){var s,a=n(this),u;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=a+"",s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,a)))}}function uhe(e,t,n){var r,i,o;return function(){var s,a=n(this),u;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=a+"",s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,a)))}}function che(e,t){var n=Zm(e),r=n==="transform"?Vfe:X4;return this.attrTween(e,typeof t=="function"?(n.local?uhe:lhe)(n,r,Nk(this,"attr."+e,t)):t==null?(n.local?ohe:ihe)(n):(n.local?ahe:she)(n,r,t))}function dhe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function fhe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function hhe(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&fhe(e,o)),n}return i._value=t,i}function phe(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&dhe(e,o)),n}return i._value=t,i}function mhe(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Zm(e);return this.tween(n,(r.local?hhe:phe)(r,t))}function ghe(e,t){return function(){_k(this,e).delay=+t.apply(this,arguments)}}function yhe(e,t){return t=+t,function(){_k(this,e).delay=t}}function vhe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ghe:yhe)(t,e)):yi(this.node(),t).delay}function xhe(e,t){return function(){Hi(this,e).duration=+t.apply(this,arguments)}}function whe(e,t){return t=+t,function(){Hi(this,e).duration=t}}function bhe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?xhe:whe)(t,e)):yi(this.node(),t).duration}function khe(e,t){if(typeof t!="function")throw new Error;return function(){Hi(this,e).ease=t}}function She(e){var t=this._id;return arguments.length?this.each(khe(t,e)):yi(this.node(),t).ease}function Ehe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Hi(this,e).ease=n}}function Che(e){if(typeof e!="function")throw new Error;return this.each(Ehe(this._id,e))}function _he(e){typeof e!="function"&&(e=T4(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],u,c=0;c<s;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&a.push(u);return new Co(r,this._parents,this._name,this._id)}function Nhe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var u=t[a],c=n[a],f=u.length,h=s[a]=new Array(f),p,m=0;m<f;++m)(p=u[m]||c[m])&&(h[m]=p);for(;a<r;++a)s[a]=t[a];return new Co(s,this._parents,this._name,this._id)}function The(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Ahe(e,t,n){var r,i,o=The(t)?_k:Hi;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function Phe(e,t){var n=this._id;return arguments.length<2?yi(this.node(),n).on.on(e):this.each(Ahe(n,e,t))}function Rhe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Mhe(){return this.on("end.remove",Rhe(this._id))}function Dhe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=kk(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],u=a.length,c=o[s]=new Array(u),f,h,p=0;p<u;++p)(f=a[p])&&(h=e.call(f,f.__data__,p,a))&&("__data__"in f&&(h.__data__=f.__data__),c[p]=h,Xm(c[p],t,n,p,c,yi(f,n)));return new Co(o,this._parents,t,n)}function Ohe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=N4(e));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var u=r[a],c=u.length,f,h=0;h<c;++h)if(f=u[h]){for(var p=e.call(f,f.__data__,h,u),m,y=yi(f,n),x=0,k=p.length;x<k;++x)(m=p[x])&&Xm(m,t,n,x,p,y);o.push(p),s.push(f)}return new Co(o,s,t,n)}var Ihe=Qd.prototype.constructor;function jhe(){return new Ihe(this._groups,this._parents)}function Lhe(e,t){var n,r,i;return function(){var o=Wl(this,e),s=(this.style.removeProperty(e),Wl(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function Q4(e){return function(){this.style.removeProperty(e)}}function Fhe(e,t,n){var r,i=n+"",o;return function(){var s=Wl(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function zhe(e,t,n){var r,i,o;return function(){var s=Wl(this,e),a=n(this),u=a+"";return a==null&&(u=a=(this.style.removeProperty(e),Wl(this,e))),s===u?null:s===r&&u===i?o:(i=u,o=t(r=s,a))}}function $he(e,t){var n,r,i,o="style."+t,s="end."+o,a;return function(){var u=Hi(this,e),c=u.on,f=u.value[o]==null?a||(a=Q4(t)):void 0;(c!==n||i!==f)&&(r=(n=c).copy()).on(s,i=f),u.on=r}}function Bhe(e,t,n){var r=(e+="")=="transform"?Bfe:X4;return t==null?this.styleTween(e,Lhe(e,r)).on("end.style."+e,Q4(e)):typeof t=="function"?this.styleTween(e,zhe(e,r,Nk(this,"style."+e,t))).each($he(this._id,e)):this.styleTween(e,Fhe(e,r,t),n).on("end.style."+e,null)}function Vhe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Whe(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Vhe(e,s,n)),r}return o._value=t,o}function Uhe(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Whe(e,t,n??""))}function Hhe(e){return function(){this.textContent=e}}function Yhe(e){return function(){var t=e(this);this.textContent=t??""}}function qhe(e){return this.tween("text",typeof e=="function"?Yhe(Nk(this,"text",e)):Hhe(e==null?"":e+""))}function Ghe(e){return function(t){this.textContent=e.call(this,t)}}function Zhe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Ghe(i)),t}return r._value=e,r}function Khe(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Zhe(e))}function Xhe(){for(var e=this._name,t=this._id,n=J4(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,u,c=0;c<a;++c)if(u=s[c]){var f=yi(u,t);Xm(u,e,n,c,s,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new Co(r,this._parents,e,n)}function Qhe(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},u={value:function(){--i===0&&o()}};n.each(function(){var c=Hi(this,r),f=c.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(u)),c.on=t}),i===0&&o()})}var Jhe=0;function Co(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function J4(){return++Jhe}var io=Qd.prototype;Co.prototype={constructor:Co,select:Dhe,selectAll:Ohe,selectChild:io.selectChild,selectChildren:io.selectChildren,filter:_he,merge:Nhe,selection:jhe,transition:Xhe,call:io.call,nodes:io.nodes,node:io.node,size:io.size,empty:io.empty,each:io.each,on:Phe,attr:che,attrTween:mhe,style:Bhe,styleTween:Uhe,text:qhe,textTween:Khe,remove:Mhe,tween:rhe,delay:vhe,duration:bhe,ease:She,easeVarying:Che,end:Qhe,[Symbol.iterator]:io[Symbol.iterator]};function epe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var tpe={time:null,delay:0,duration:250,ease:epe};function npe(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function rpe(e){var t,n;e instanceof Co?(t=e._id,e=e._name):(t=J4(),(n=tpe).time=Ck(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,u,c=0;c<a;++c)(u=s[c])&&Xm(u,e,t,c,s,n||npe(u,t));return new Co(r,this._parents,e,t)}Qd.prototype.interrupt=ehe;Qd.prototype.transition=rpe;const Lh=e=>()=>e;function ipe(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function ho(e,t,n){this.k=e,this.x=t,this.y=n}ho.prototype={constructor:ho,scale:function(e){return e===1?this:new ho(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ho(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Qm=new ho(1,0,0);e5.prototype=ho.prototype;function e5(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Qm;return e.__zoom}function Sx(e){e.stopImmediatePropagation()}function cc(e){e.preventDefault(),e.stopImmediatePropagation()}function ope(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function spe(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function uA(){return this.__zoom||Qm}function ape(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function lpe(){return navigator.maxTouchPoints||"ontouchstart"in this}function upe(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function t5(){var e=ope,t=spe,n=upe,r=ape,i=lpe,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,u=Yfe,c=Gm("start","zoom","end"),f,h,p,m=500,y=150,x=0,k=10;function w(I){I.property("__zoom",uA).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",R).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(I,Y,q,Z){var B=I.selection?I.selection():I;B.property("__zoom",uA),I!==B?P(I,Y,q,Z):B.interrupt().each(function(){A(this,arguments).event(Z).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},w.scaleBy=function(I,Y,q,Z){w.scaleTo(I,function(){var B=this.__zoom.k,W=typeof Y=="function"?Y.apply(this,arguments):Y;return B*W},q,Z)},w.scaleTo=function(I,Y,q,Z){w.transform(I,function(){var B=t.apply(this,arguments),W=this.__zoom,L=q==null?N(B):typeof q=="function"?q.apply(this,arguments):q,U=W.invert(L),V=typeof Y=="function"?Y.apply(this,arguments):Y;return n(C(E(W,V),L,U),B,s)},q,Z)},w.translateBy=function(I,Y,q,Z){w.transform(I,function(){return n(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof q=="function"?q.apply(this,arguments):q),t.apply(this,arguments),s)},null,Z)},w.translateTo=function(I,Y,q,Z,B){w.transform(I,function(){var W=t.apply(this,arguments),L=this.__zoom,U=Z==null?N(W):typeof Z=="function"?Z.apply(this,arguments):Z;return n(Qm.translate(U[0],U[1]).scale(L.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof q=="function"?-q.apply(this,arguments):-q),W,s)},Z,B)};function E(I,Y){return Y=Math.max(o[0],Math.min(o[1],Y)),Y===I.k?I:new ho(Y,I.x,I.y)}function C(I,Y,q){var Z=Y[0]-q[0]*I.k,B=Y[1]-q[1]*I.k;return Z===I.x&&B===I.y?I:new ho(I.k,Z,B)}function N(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function P(I,Y,q,Z){I.on("start.zoom",function(){A(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(Z).end()}).tween("zoom",function(){var B=this,W=arguments,L=A(B,W).event(Z),U=t.apply(B,W),V=q==null?N(U):typeof q=="function"?q.apply(B,W):q,D=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),G=B.__zoom,K=typeof Y=="function"?Y.apply(B,W):Y,J=u(G.invert(V).concat(D/G.k),K.invert(V).concat(D/K.k));return function(ee){if(ee===1)ee=K;else{var re=J(ee),ue=D/re[2];ee=new ho(ue,V[0]-re[0]*ue,V[1]-re[1]*ue)}L.zoom(null,ee)}})}function A(I,Y,q){return!q&&I.__zooming||new O(I,Y)}function O(I,Y){this.that=I,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=t.apply(I,Y),this.taps=0}O.prototype={event:function(I){return I&&(this.sourceEvent=I),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(I,Y){return this.mouse&&I!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var Y=Sr(this.that).datum();c.call(I,this.that,new ipe(I,{sourceEvent:this.sourceEvent,target:w,type:I,transform:this.that.__zoom,dispatch:c}),Y)}};function M(I,...Y){if(!e.apply(this,arguments))return;var q=A(this,Y).event(I),Z=this.__zoom,B=Math.max(o[0],Math.min(o[1],Z.k*Math.pow(2,r.apply(this,arguments)))),W=ii(I);if(q.wheel)(q.mouse[0][0]!==W[0]||q.mouse[0][1]!==W[1])&&(q.mouse[1]=Z.invert(q.mouse[0]=W)),clearTimeout(q.wheel);else{if(Z.k===B)return;q.mouse=[W,Z.invert(W)],ip(this),q.start()}cc(I),q.wheel=setTimeout(L,y),q.zoom("mouse",n(C(E(Z,B),q.mouse[0],q.mouse[1]),q.extent,s));function L(){q.wheel=null,q.end()}}function j(I,...Y){if(p||!e.apply(this,arguments))return;var q=I.currentTarget,Z=A(this,Y,!0).event(I),B=Sr(I.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",D,!0),W=ii(I,q),L=I.clientX,U=I.clientY;F4(I.view),Sx(I),Z.mouse=[W,this.__zoom.invert(W)],ip(this),Z.start();function V(G){if(cc(G),!Z.moved){var K=G.clientX-L,J=G.clientY-U;Z.moved=K*K+J*J>x}Z.event(G).zoom("mouse",n(C(Z.that.__zoom,Z.mouse[0]=ii(G,q),Z.mouse[1]),Z.extent,s))}function D(G){B.on("mousemove.zoom mouseup.zoom",null),z4(G.view,Z.moved),cc(G),Z.event(G).end()}}function R(I,...Y){if(e.apply(this,arguments)){var q=this.__zoom,Z=ii(I.changedTouches?I.changedTouches[0]:I,this),B=q.invert(Z),W=q.k*(I.shiftKey?.5:2),L=n(C(E(q,W),Z,B),t.apply(this,Y),s);cc(I),a>0?Sr(this).transition().duration(a).call(P,L,Z,I):Sr(this).call(w.transform,L,Z,I)}}function $(I,...Y){if(e.apply(this,arguments)){var q=I.touches,Z=q.length,B=A(this,Y,I.changedTouches.length===Z).event(I),W,L,U,V;for(Sx(I),L=0;L<Z;++L)U=q[L],V=ii(U,this),V=[V,this.__zoom.invert(V),U.identifier],B.touch0?!B.touch1&&B.touch0[2]!==V[2]&&(B.touch1=V,B.taps=0):(B.touch0=V,W=!0,B.taps=1+!!f);f&&(f=clearTimeout(f)),W&&(B.taps<2&&(h=V[0],f=setTimeout(function(){f=null},m)),ip(this),B.start())}}function F(I,...Y){if(this.__zooming){var q=A(this,Y).event(I),Z=I.changedTouches,B=Z.length,W,L,U,V;for(cc(I),W=0;W<B;++W)L=Z[W],U=ii(L,this),q.touch0&&q.touch0[2]===L.identifier?q.touch0[0]=U:q.touch1&&q.touch1[2]===L.identifier&&(q.touch1[0]=U);if(L=q.that.__zoom,q.touch1){var D=q.touch0[0],G=q.touch0[1],K=q.touch1[0],J=q.touch1[1],ee=(ee=K[0]-D[0])*ee+(ee=K[1]-D[1])*ee,re=(re=J[0]-G[0])*re+(re=J[1]-G[1])*re;L=E(L,Math.sqrt(ee/re)),U=[(D[0]+K[0])/2,(D[1]+K[1])/2],V=[(G[0]+J[0])/2,(G[1]+J[1])/2]}else if(q.touch0)U=q.touch0[0],V=q.touch0[1];else return;q.zoom("touch",n(C(L,U,V),q.extent,s))}}function H(I,...Y){if(this.__zooming){var q=A(this,Y).event(I),Z=I.changedTouches,B=Z.length,W,L;for(Sx(I),p&&clearTimeout(p),p=setTimeout(function(){p=null},m),W=0;W<B;++W)L=Z[W],q.touch0&&q.touch0[2]===L.identifier?delete q.touch0:q.touch1&&q.touch1[2]===L.identifier&&delete q.touch1;if(q.touch1&&!q.touch0&&(q.touch0=q.touch1,delete q.touch1),q.touch0)q.touch0[1]=this.__zoom.invert(q.touch0[0]);else if(q.end(),q.taps===2&&(L=ii(L,this),Math.hypot(h[0]-L[0],h[1]-L[1])<k)){var U=Sr(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return w.wheelDelta=function(I){return arguments.length?(r=typeof I=="function"?I:Lh(+I),w):r},w.filter=function(I){return arguments.length?(e=typeof I=="function"?I:Lh(!!I),w):e},w.touchable=function(I){return arguments.length?(i=typeof I=="function"?I:Lh(!!I),w):i},w.extent=function(I){return arguments.length?(t=typeof I=="function"?I:Lh([[+I[0][0],+I[0][1]],[+I[1][0],+I[1][1]]]),w):t},w.scaleExtent=function(I){return arguments.length?(o[0]=+I[0],o[1]=+I[1],w):[o[0],o[1]]},w.translateExtent=function(I){return arguments.length?(s[0][0]=+I[0][0],s[1][0]=+I[1][0],s[0][1]=+I[0][1],s[1][1]=+I[1][1],w):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},w.constrain=function(I){return arguments.length?(n=I,w):n},w.duration=function(I){return arguments.length?(a=+I,w):a},w.interpolate=function(I){return arguments.length?(u=I,w):u},w.on=function(){var I=c.on.apply(c,arguments);return I===c?w:I},w.clickDistance=function(I){return arguments.length?(x=(I=+I)*I,w):Math.sqrt(x)},w.tapDistance=function(I){return arguments.length?(k=+I,w):k},w}const Po={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},gd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],n5=["Enter"," ","Escape"];var Hl;(function(e){e.Strict="strict",e.Loose="loose"})(Hl||(Hl={}));var sa;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(sa||(sa={}));var yd;(function(e){e.Partial="partial",e.Full="full"})(yd||(yd={}));const r5={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var ls;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ls||(ls={}));var vd;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(vd||(vd={}));var We;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(We||(We={}));const cA={[We.Left]:We.Right,[We.Right]:We.Left,[We.Top]:We.Bottom,[We.Bottom]:We.Top};function i5(e){return e===null?null:e?"valid":"invalid"}const o5=e=>"id"in e&&"source"in e&&"target"in e,cpe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Tk=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ef=(e,t=[0,0])=>{const{width:n,height:r}=Ro(e),i=e.origin??t,o=n*i[0],s=r*i[1];return{x:e.position.x-o,y:e.position.y-s}},dpe=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const o=typeof i=="string";let s=!t.nodeLookup&&!o?i:void 0;t.nodeLookup&&(s=o?t.nodeLookup.get(i):Tk(i)?i:t.nodeLookup.get(i.id));const a=s?Kp(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Jm(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return eg(n)},tf=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const i=Kp(r);n=Jm(n,i)}}),eg(n)},s5=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1)=>{const a={...nf(t,[n,r,i]),width:t.width/i,height:t.height/i},u=[];for(const c of e.values()){const{measured:f,selectable:h=!0,hidden:p=!1}=c;if(s&&!h||p)continue;const m=f.width??c.width??c.initialWidth??null,y=f.height??c.height??c.initialHeight??null,x=xd(a,ql(c)),k=(m??0)*(y??0),w=o&&x>0;(!c.internals.handleBounds||w||x>=k||c.dragging)&&u.push(c)}return u},fpe=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Kw(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function Xw({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:o},s){if(e.size===0)return Promise.resolve(!1);const a=tf(e),u=Ak(a,t,n,(s==null?void 0:s.minZoom)??i,(s==null?void 0:s.maxZoom)??o,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration}),Promise.resolve(!0)}function a5({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:o}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:u,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},f=s.origin??r;let h=i;if(s.extent==="parent"&&!s.expandParent)if(!a)o==null||o("005",Po.error005());else{const m=a.measured.width,y=a.measured.height;m&&y&&(h=[[u,c],[u+m,c+y]])}else a&&Gl(s.extent)&&(h=[[s.extent[0][0]+u,s.extent[0][1]+c],[s.extent[1][0]+u,s.extent[1][1]+c]]);const p=Gl(h)?ya(t,h,s.measured):t;return{position:{x:p.x-u+s.measured.width*f[0],y:p.y-c+s.measured.height*f[1]},positionAbsolute:p}}async function hpe({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const o=new Set(e.map(p=>p.id)),s=[];for(const p of n){if(p.deletable===!1)continue;const m=o.has(p.id),y=!m&&p.parentId&&s.find(x=>x.id===p.parentId);(m||y)&&s.push(p)}const a=new Set(t.map(p=>p.id)),u=r.filter(p=>p.deletable!==!1),f=fpe(s,u);for(const p of u)a.has(p.id)&&!f.find(y=>y.id===p.id)&&f.push(p);if(!i)return{edges:f,nodes:s};const h=await i({nodes:s,edges:f});return typeof h=="boolean"?h?{edges:f,nodes:s}:{edges:[],nodes:[]}:h}const Yl=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ya=(e={x:0,y:0},t,n)=>({x:Yl(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Yl(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function l5(e,t,n){const{width:r,height:i}=Ro(n),{x:o,y:s}=n.internals.positionAbsolute;return ya(e,[[o,s],[o+r,s+i]],t)}const dA=(e,t,n)=>e<t?Yl(Math.abs(e-t),1,t)/t:e>n?-Yl(Math.abs(e-n),1,t)/t:0,u5=(e,t,n=15,r=40)=>{const i=dA(e.x,r,t.width-r)*n,o=dA(e.y,r,t.height-r)*n;return[i,o]},Jm=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Qw=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),eg=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ql=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=Tk(e)?e.internals.positionAbsolute:ef(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Kp=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=Tk(e)?e.internals.positionAbsolute:ef(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},c5=(e,t)=>eg(Jm(Qw(e),Qw(t))),xd=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},fA=e=>li(e.width)&&li(e.height)&&li(e.x)&&li(e.y),li=e=>!isNaN(e)&&isFinite(e),ppe=(e,t)=>{},tg=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),nf=({x:e,y:t},[n,r,i],o=!1,s=[1,1])=>{const a={x:(e-n)/i,y:(t-r)/i};return o?tg(a,s):a},d5=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),Ak=(e,t,n,r,i,o)=>{const s=t/(e.width*(1+o)),a=n/(e.height*(1+o)),u=Math.min(s,a),c=Yl(u,r,i),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*c,m=n/2-h*c;return{x:p,y:m,zoom:c}},Xp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Gl(e){return e!==void 0&&e!=="parent"}function Ro(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function f5(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function h5(e,t={width:0,height:0},n,r,i){const o={...e},s=r.get(n);if(s){const a=s.origin||i;o.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],o.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return o}function Dc(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:o,y:s}=yo(e),a=nf({x:o-((i==null?void 0:i.left)??0),y:s-((i==null?void 0:i.top)??0)},r),{x:u,y:c}=n?tg(a,t):a;return{xSnapped:u,ySnapped:c,...a}}const ng=e=>({width:e.offsetWidth,height:e.offsetHeight}),p5=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},mpe=["INPUT","SELECT","TEXTAREA"];function Jw(e){var r,i,o;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return mpe.includes(t==null?void 0:t.nodeName)||((o=t==null?void 0:t.hasAttribute)==null?void 0:o.call(t,"contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const m5=e=>"clientX"in e,yo=(e,t)=>{var o,s;const n=m5(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},hA=(e,t,n,r,i)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...ng(s)}})};function g5({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:a}){const u=e*.125+i*.375+s*.375+n*.125,c=t*.125+o*.375+a*.375+r*.125,f=Math.abs(u-e),h=Math.abs(c-t);return[u,c,f,h]}function Fh(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function pA({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case We.Left:return[t-Fh(t-r,o),n];case We.Right:return[t+Fh(r-t,o),n];case We.Top:return[t,n-Fh(n-i,o)];case We.Bottom:return[t,n+Fh(i-n,o)]}}function y5({sourceX:e,sourceY:t,sourcePosition:n=We.Bottom,targetX:r,targetY:i,targetPosition:o=We.Top,curvature:s=.25}){const[a,u]=pA({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[c,f]=pA({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[h,p,m,y]=g5({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:u,targetControlX:c,targetControlY:f});return[`M${e},${t} C${a},${u} ${c},${f} ${r},${i}`,h,p,m,y]}function v5({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[o,a,i,s]}function gpe({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1}){if(!i)return r;const o=n||t.selected||e.selected,s=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(o?s:0)}function ype({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const o=Jm(Kp(e),Kp(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const s={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return xd(s,eg(o))>0}const vpe=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,xpe=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),wpe=(e,t)=>{if(!e.source||!e.target)return t;let n;return o5(e)?n={...e}:n={...e,id:vpe(e)},xpe(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function x5({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,a]=v5({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,a]}const mA={[We.Left]:{x:-1,y:0},[We.Right]:{x:1,y:0},[We.Top]:{x:0,y:-1},[We.Bottom]:{x:0,y:1}},bpe=({source:e,sourcePosition:t=We.Bottom,target:n})=>t===We.Left||t===We.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},gA=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function kpe({source:e,sourcePosition:t=We.Bottom,target:n,targetPosition:r=We.Top,center:i,offset:o}){const s=mA[t],a=mA[r],u={x:e.x+s.x*o,y:e.y+s.y*o},c={x:n.x+a.x*o,y:n.y+a.y*o},f=bpe({source:u,sourcePosition:t,target:c}),h=f.x!==0?"x":"y",p=f[h];let m=[],y,x;const k={x:0,y:0},w={x:0,y:0},[E,C,N,P]=v5({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[h]*a[h]===-1){y=i.x??E,x=i.y??C;const O=[{x:y,y:u.y},{x:y,y:c.y}],M=[{x:u.x,y:x},{x:c.x,y:x}];s[h]===p?m=h==="x"?O:M:m=h==="x"?M:O}else{const O=[{x:u.x,y:c.y}],M=[{x:c.x,y:u.y}];if(h==="x"?m=s.x===p?M:O:m=s.y===p?O:M,t===r){const H=Math.abs(e[h]-n[h]);if(H<=o){const I=Math.min(o-1,o-H);s[h]===p?k[h]=(u[h]>e[h]?-1:1)*I:w[h]=(c[h]>n[h]?-1:1)*I}}if(t!==r){const H=h==="x"?"y":"x",I=s[h]===a[H],Y=u[H]>c[H],q=u[H]<c[H];(s[h]===1&&(!I&&Y||I&&q)||s[h]!==1&&(!I&&q||I&&Y))&&(m=h==="x"?O:M)}const j={x:u.x+k.x,y:u.y+k.y},R={x:c.x+w.x,y:c.y+w.y},$=Math.max(Math.abs(j.x-m[0].x),Math.abs(R.x-m[0].x)),F=Math.max(Math.abs(j.y-m[0].y),Math.abs(R.y-m[0].y));$>=F?(y=(j.x+R.x)/2,x=m[0].y):(y=m[0].x,x=(j.y+R.y)/2)}return[[e,{x:u.x+k.x,y:u.y+k.y},...m,{x:c.x+w.x,y:c.y+w.y},n],y,x,N,P]}function Spe(e,t,n,r){const i=Math.min(gA(e,t)/2,gA(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,f=e.y<n.y?1:-1;return`L ${o+i*c},${s}Q ${o},${s} ${o},${s+i*f}`}const a=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${s+i*u}Q ${o},${s} ${o+i*a},${s}`}function eb({sourceX:e,sourceY:t,sourcePosition:n=We.Bottom,targetX:r,targetY:i,targetPosition:o=We.Top,borderRadius:s=5,centerX:a,centerY:u,offset:c=20}){const[f,h,p,m,y]=kpe({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:a,y:u},offset:c});return[f.reduce((k,w,E)=>{let C="";return E>0&&E<f.length-1?C=Spe(f[E-1],w,f[E+1],s):C=`${E===0?"M":"L"}${w.x} ${w.y}`,k+=C,k},""),h,p,m,y]}function yA(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Epe(e){var h;const{sourceNode:t,targetNode:n}=e;if(!yA(t)||!yA(n))return null;const r=t.internals.handleBounds||vA(t.handles),i=n.internals.handleBounds||vA(n.handles),o=xA((r==null?void 0:r.source)??[],e.sourceHandle),s=xA(e.connectionMode===Hl.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!o||!s)return(h=e.onError)==null||h.call(e,"008",Po.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(o==null?void 0:o.position)||We.Bottom,u=(s==null?void 0:s.position)||We.Top,c=wd(t,o,a),f=wd(n,s,u);return{sourceX:c.x,sourceY:c.y,targetX:f.x,targetY:f.y,sourcePosition:a,targetPosition:u}}function vA(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function wd(e,t,n=We.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??Ro(e);if(r)return{x:i+s/2,y:o+a/2};switch((t==null?void 0:t.position)??n){case We.Top:return{x:i+s/2,y:o};case We.Right:return{x:i+s,y:o+a/2};case We.Bottom:return{x:i+s/2,y:o+a};case We.Left:return{x:i,y:o+a/2}}}function xA(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function tb(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Cpe(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const o=new Set;return e.reduce((s,a)=>([a.markerStart||r,a.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const c=tb(u,t);o.has(c)||(s.push({id:c,color:u.color||n,...u}),o.add(c))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const Pk={nodeOrigin:[0,0],nodeExtent:gd,elevateNodesOnSelect:!0,defaults:{}},_pe={...Pk,checkEquality:!0};function Rk(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Npe(e,t,n){const r=Rk(Pk,n);for(const i of e.values())if(i.parentId)Mk(i,e,t,r);else{const o=ef(i,r.nodeOrigin),s=Gl(i.extent)?i.extent:r.nodeExtent,a=ya(o,s,Ro(i));i.internals.positionAbsolute=a}}function nb(e,t,n,r){var a,u;const i=Rk(_pe,r),o=new Map(t),s=i!=null&&i.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const c of e){let f=o.get(c.id);if(i.checkEquality&&c===(f==null?void 0:f.internals.userNode))t.set(c.id,f);else{const h=ef(c,i.nodeOrigin),p=Gl(c.extent)?c.extent:i.nodeExtent,m=ya(h,p,Ro(c));f={...i.defaults,...c,measured:{width:(a=c.measured)==null?void 0:a.width,height:(u=c.measured)==null?void 0:u.height},internals:{positionAbsolute:m,handleBounds:c.measured?f==null?void 0:f.internals.handleBounds:void 0,z:w5(c,s),userNode:c}},t.set(c.id,f)}c.parentId&&Mk(f,t,n,r)}}function Tpe(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Mk(e,t,n,r){const{elevateNodesOnSelect:i,nodeOrigin:o,nodeExtent:s}=Rk(Pk,r),a=e.parentId,u=t.get(a);if(!u){console.warn(`Parent node ${a} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Tpe(e,n);const c=i?1e3:0,{x:f,y:h,z:p}=Ape(e,u,o,s,c),{positionAbsolute:m}=e.internals,y=f!==m.x||h!==m.y;(y||p!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:y?{x:f,y:h}:m,z:p})}function w5(e,t){return(li(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Ape(e,t,n,r,i){const{x:o,y:s}=t.internals.positionAbsolute,a=Ro(e),u=ef(e,n),c=Gl(e.extent)?ya(u,e.extent,a):u;let f=ya({x:o+c.x,y:s+c.y},r,a);e.extent==="parent"&&(f=l5(f,a,t));const h=w5(e,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>h?p:h}}function Dk(e,t,n,r=[0,0]){var s;const i=[],o=new Map;for(const a of e){const u=t.get(a.parentId);if(!u)continue;const c=((s=o.get(a.parentId))==null?void 0:s.expandedRect)??ql(u),f=c5(c,a.rect);o.set(a.parentId,{expandedRect:f,parent:u})}return o.size>0&&o.forEach(({expandedRect:a,parent:u},c)=>{var C;const f=u.internals.positionAbsolute,h=Ro(u),p=u.origin??r,m=a.x<f.x?Math.round(Math.abs(f.x-a.x)):0,y=a.y<f.y?Math.round(Math.abs(f.y-a.y)):0,x=Math.max(h.width,Math.round(a.width)),k=Math.max(h.height,Math.round(a.height)),w=(x-h.width)*p[0],E=(k-h.height)*p[1];(m>0||y>0||w||E)&&(i.push({id:c,type:"position",position:{x:u.position.x-m+w,y:u.position.y-y+E}}),(C=n.get(c))==null||C.forEach(N=>{e.some(P=>P.id===N.id)||i.push({id:N.id,type:"position",position:{x:N.position.x+m,y:N.position.y+y}})})),(h.width<a.width||h.height<a.height||m||y)&&i.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:x+(m?p[0]*m-w:0),height:k+(y?p[1]*y-E:0)}})}),i}function Ppe(e,t,n,r,i,o){const s=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!s)return{changes:[],updatedInternals:a};const u=[],c=window.getComputedStyle(s),{m22:f}=new window.DOMMatrixReadOnly(c.transform),h=[];for(const p of e.values()){const m=t.get(p.id);if(m)if(m.hidden)m.internals={...m.internals,handleBounds:void 0},a=!0;else{const y=ng(p.nodeElement),x=m.measured.width!==y.width||m.measured.height!==y.height;if(!!(y.width&&y.height&&(x||!m.internals.handleBounds||p.force))){const w=p.nodeElement.getBoundingClientRect(),E=Gl(m.extent)?m.extent:o;let{positionAbsolute:C}=m.internals;m.parentId&&m.extent==="parent"?C=l5(C,y,t.get(m.parentId)):E&&(C=ya(C,E,y)),m.measured=y,m.internals={...m.internals,positionAbsolute:C,handleBounds:{source:hA("source",p.nodeElement,w,f,m.id),target:hA("target",p.nodeElement,w,f,m.id)}},m.parentId&&Mk(m,t,n,{nodeOrigin:i}),a=!0,x&&(u.push({id:m.id,type:"dimensions",dimensions:y}),m.expandParent&&m.parentId&&h.push({id:m.id,parentId:m.parentId,rect:ql(m,i)}))}}}if(h.length>0){const p=Dk(h,t,n,i);u.push(...p)}return{changes:u,updatedInternals:a}}async function Rpe({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,o]],r),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function b5(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:o,sourceHandle:s=null,targetHandle:a=null}=r,u=`${i}-source-${s}`,c=`${o}-target-${a}`,f=e.get(u)||new Map,h=e.get(c)||new Map,p={edgeId:r.id,source:i,target:o,sourceHandle:s,targetHandle:a};t.set(r.id,r),e.set(u,f.set(`${o}-${a}`,p)),e.set(c,h.set(`${i}-${s}`,p))}}function k5(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:k5(n,t):!1}function wA(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n)return!1;r=r.parentElement}while(r);return!1}function Mpe(e,t,n,r){const i=new Map;for(const[o,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!k5(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(o);a&&i.set(o,{id:o,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return i}function Ex({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,a,u;const i=[];for(const[c,f]of t){const h=(s=n.get(c))==null?void 0:s.internals.userNode;h&&i.push({...h,position:f.position,dragging:r})}if(!e)return[i[0],i];const o=(a=n.get(e))==null?void 0:a.internals.userNode;return[o?{...o,position:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:i[0],i]}function Dpe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},s=0,a=new Map,u=!1,c={x:0,y:0},f=null,h=!1,p=null,m=!1;function y({noDragClassName:k,handleSelector:w,domNode:E,isSelectable:C,nodeId:N,nodeClickDistance:P=0}){p=Sr(E);function A({x:R,y:$},F){const{nodeLookup:H,nodeExtent:I,snapGrid:Y,snapToGrid:q,nodeOrigin:Z,onNodeDrag:B,onSelectionDrag:W,onError:L,updateNodePositions:U}=t();o={x:R,y:$};let V=!1,D={x:0,y:0,x2:0,y2:0};if(a.size>1&&I){const G=tf(a);D=Qw(G)}for(const[G,K]of a){if(!H.has(G))continue;let J={x:R-K.distance.x,y:$-K.distance.y};q&&(J=tg(J,Y));let ee=[[I[0][0],I[0][1]],[I[1][0],I[1][1]]];if(a.size>1&&I&&!K.extent){const{positionAbsolute:he}=K.internals,be=he.x-D.x+I[0][0],fe=he.x+K.measured.width-D.x2+I[1][0],ve=he.y-D.y+I[0][1],Me=he.y+K.measured.height-D.y2+I[1][1];ee=[[be,ve],[fe,Me]]}const{position:re,positionAbsolute:ue}=a5({nodeId:G,nextPosition:J,nodeLookup:H,nodeExtent:ee,nodeOrigin:Z,onError:L});V=V||K.position.x!==re.x||K.position.y!==re.y,K.position=re,K.internals.positionAbsolute=ue}if(V&&(U(a,!0),F&&(r||B||!N&&W))){const[G,K]=Ex({nodeId:N,dragItems:a,nodeLookup:H});r==null||r(F,a,G,K),B==null||B(F,G,K),N||W==null||W(F,K)}}async function O(){if(!f)return;const{transform:R,panBy:$,autoPanSpeed:F}=t(),[H,I]=u5(c,f,F);(H!==0||I!==0)&&(o.x=(o.x??0)-H/R[2],o.y=(o.y??0)-I/R[2],await $({x:H,y:I})&&A(o,null)),s=requestAnimationFrame(O)}function M(R){var V;const{nodeLookup:$,multiSelectionActive:F,nodesDraggable:H,transform:I,snapGrid:Y,snapToGrid:q,selectNodesOnDrag:Z,onNodeDragStart:B,onSelectionDragStart:W,unselectNodesAndEdges:L}=t();h=!0,(!Z||!C)&&!F&&N&&((V=$.get(N))!=null&&V.selected||L()),C&&Z&&N&&(e==null||e(N));const U=Dc(R.sourceEvent,{transform:I,snapGrid:Y,snapToGrid:q,containerBounds:f});if(o=U,a=Mpe($,H,U,N),a.size>0&&(n||B||!N&&W)){const[D,G]=Ex({nodeId:N,dragItems:a,nodeLookup:$});n==null||n(R.sourceEvent,a,D,G),B==null||B(R.sourceEvent,D,G),N||W==null||W(R.sourceEvent,G)}}const j=$4().clickDistance(P).on("start",R=>{const{domNode:$,nodeDragThreshold:F,transform:H,snapGrid:I,snapToGrid:Y}=t();f=($==null?void 0:$.getBoundingClientRect())||null,m=!1,F===0&&M(R),o=Dc(R.sourceEvent,{transform:H,snapGrid:I,snapToGrid:Y,containerBounds:f}),c=yo(R.sourceEvent,f)}).on("drag",R=>{const{autoPanOnNodeDrag:$,transform:F,snapGrid:H,snapToGrid:I,nodeDragThreshold:Y,nodeLookup:q}=t(),Z=Dc(R.sourceEvent,{transform:F,snapGrid:H,snapToGrid:I,containerBounds:f});if((R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1||N&&!q.has(N))&&(m=!0),!m){if(!u&&$&&h&&(u=!0,O()),!h){const B=Z.xSnapped-(o.x??0),W=Z.ySnapped-(o.y??0);Math.sqrt(B*B+W*W)>Y&&M(R)}(o.x!==Z.xSnapped||o.y!==Z.ySnapped)&&a&&h&&(c=yo(R.sourceEvent,f),A(Z,R.sourceEvent))}}).on("end",R=>{if(!(!h||m)&&(u=!1,h=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:$,updateNodePositions:F,onNodeDragStop:H,onSelectionDragStop:I}=t();if(F(a,!1),i||H||!N&&I){const[Y,q]=Ex({nodeId:N,dragItems:a,nodeLookup:$,dragging:!1});i==null||i(R.sourceEvent,a,Y,q),H==null||H(R.sourceEvent,Y,q),N||I==null||I(R.sourceEvent,q)}}}).filter(R=>{const $=R.target;return!R.button&&(!k||!wA($,`.${k}`,E))&&(!w||wA($,w,E))});p.call(j)}function x(){p==null||p.on(".drag",null)}return{update:y,destroy:x}}function Ope(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())xd(i,ql(o))>0&&r.push(o);return r}const Ipe=250;function jpe(e,t,n,r){var a,u;let i=[],o=1/0;const s=Ope(e,n,t+Ipe);for(const c of s){const f=[...((a=c.internals.handleBounds)==null?void 0:a.source)??[],...((u=c.internals.handleBounds)==null?void 0:u.target)??[]];for(const h of f){if(r.nodeId===h.nodeId&&r.type===h.type&&r.id===h.id)continue;const{x:p,y:m}=wd(c,h,h.position,!0),y=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));y>t||(y<o?(i=[{...h,x:p,y:m}],o=y):y===o&&i.push({...h,x:p,y:m}))}}if(!i.length)return null;if(i.length>1){const c=r.type==="source"?"target":"source";return i.find(f=>f.type===c)??i[0]}return i[0]}function S5(e,t,n,r,i,o=!1){var c,f,h;const s=r.get(e);if(!s)return null;const a=i==="strict"?(c=s.internals.handleBounds)==null?void 0:c[t]:[...((f=s.internals.handleBounds)==null?void 0:f.source)??[],...((h=s.internals.handleBounds)==null?void 0:h.target)??[]],u=(n?a==null?void 0:a.find(p=>p.id===n):a==null?void 0:a[0])??null;return u&&o?{...u,...wd(s,u,u.position,!0)}:u}function E5(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Lpe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const C5=()=>!0;function Fpe(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:s,domNode:a,nodeLookup:u,lib:c,autoPanOnConnect:f,flowId:h,panBy:p,cancelConnection:m,onConnectStart:y,onConnect:x,onConnectEnd:k,isValidConnection:w=C5,onReconnectEnd:E,updateConnection:C,getTransform:N,getFromHandle:P,autoPanSpeed:A}){const O=p5(e.target);let M=0,j;const{x:R,y:$}=yo(e),F=O==null?void 0:O.elementFromPoint(R,$),H=E5(o,F),I=a==null?void 0:a.getBoundingClientRect();if(!I||!H)return;const Y=S5(i,H,r,u,t);if(!Y)return;let q=yo(e,I),Z=!1,B=null,W=!1,L=null;function U(){if(!f||!I)return;const[ue,he]=u5(q,I,A);p({x:ue,y:he}),M=requestAnimationFrame(U)}const V={...Y,nodeId:i,type:H,position:Y.position},D=u.get(i),K={inProgress:!0,isValid:null,from:wd(D,V,We.Left,!0),fromHandle:V,fromPosition:V.position,fromNode:D,to:q,toHandle:null,toPosition:cA[V.position],toNode:null};C(K);let J=K;y==null||y(e,{nodeId:i,handleId:r,handleType:H});function ee(ue){if(!P()||!V){re(ue);return}const he=N();q=yo(ue,I),j=jpe(nf(q,he,!1,[1,1]),n,u,V),Z||(U(),Z=!0);const be=_5(ue,{handle:j,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:s?"target":"source",isValidConnection:w,doc:O,lib:c,flowId:h,nodeLookup:u});L=be.handleDomNode,B=be.connection,W=Lpe(!!j,be.isValid);const fe={...J,isValid:W,to:j&&W?d5({x:j.x,y:j.y},he):q,toHandle:be.toHandle,toPosition:W&&be.toHandle?be.toHandle.position:cA[V.position],toNode:be.toHandle?u.get(be.toHandle.nodeId):null};W&&j&&J.toHandle&&fe.toHandle&&J.toHandle.type===fe.toHandle.type&&J.toHandle.nodeId===fe.toHandle.nodeId&&J.toHandle.id===fe.toHandle.id&&J.to.x===fe.to.x&&J.to.y===fe.to.y||(C(fe),J=fe)}function re(ue){(j||L)&&B&&W&&(x==null||x(B));const{inProgress:he,...be}=J,fe={...be,toPosition:J.toHandle?J.toPosition:null};k==null||k(ue,fe),o&&(E==null||E(ue,fe)),m(),cancelAnimationFrame(M),Z=!1,W=!1,B=null,L=null,O.removeEventListener("mousemove",ee),O.removeEventListener("mouseup",re),O.removeEventListener("touchmove",ee),O.removeEventListener("touchend",re)}O.addEventListener("mousemove",ee),O.addEventListener("mouseup",re),O.addEventListener("touchmove",ee),O.addEventListener("touchend",re)}function _5(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:s,lib:a,flowId:u,isValidConnection:c=C5,nodeLookup:f}){const h=o==="target",p=t?s.querySelector(`.${a}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y}=yo(e),x=s.elementFromPoint(m,y),k=x!=null&&x.classList.contains(`${a}-flow__handle`)?x:p,w={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const E=E5(void 0,k),C=k.getAttribute("data-nodeid"),N=k.getAttribute("data-handleid"),P=k.classList.contains("connectable"),A=k.classList.contains("connectableend");if(!C||!E)return w;const O={source:h?C:r,sourceHandle:h?N:i,target:h?r:C,targetHandle:h?i:N};w.connection=O;const j=P&&A&&(n===Hl.Strict?h&&E==="source"||!h&&E==="target":C!==r||N!==i);w.isValid=j&&c(O),w.toHandle=S5(C,E,N,f,n,!1)}return w}const rb={onPointerDown:Fpe,isValid:_5};function zpe({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Sr(e);function o({translateExtent:a,width:u,height:c,zoomStep:f=10,pannable:h=!0,zoomable:p=!0,inversePan:m=!1}){const y=C=>{const N=n();if(C.sourceEvent.type!=="wheel"||!t)return;const P=-C.sourceEvent.deltaY*(C.sourceEvent.deltaMode===1?.05:C.sourceEvent.deltaMode?1:.002)*f,A=N[2]*Math.pow(2,P);t.scaleTo(A)};let x=[0,0];const k=C=>{(C.sourceEvent.type==="mousedown"||C.sourceEvent.type==="touchstart")&&(x=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY])},w=C=>{const N=n();if(C.sourceEvent.type!=="mousemove"&&C.sourceEvent.type!=="touchmove"||!t)return;const P=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY],A=[P[0]-x[0],P[1]-x[1]];x=P;const O=r()*Math.max(N[2],Math.log(N[2]))*(m?-1:1),M={x:N[0]-A[0]*O,y:N[1]-A[1]*O},j=[[0,0],[u,c]];t.setViewportConstrained({x:M.x,y:M.y,zoom:N[2]},j,a)},E=t5().on("start",k).on("zoom",h?w:null).on("zoom.wheel",p?y:null);i.call(E,{})}function s(){i.on("zoom",null)}return{update:o,destroy:s,pointer:ii}}const $pe=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,rg=e=>({x:e.x,y:e.y,zoom:e.k}),Cx=({x:e,y:t,zoom:n})=>Qm.translate(e,t).scale(n),gl=(e,t)=>e.target.closest(`.${t}`),N5=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),_x=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},T5=e=>{const t=e.ctrlKey&&Xp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Bpe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:u,onPanZoomEnd:c}){return f=>{if(gl(f,t))return!1;f.preventDefault(),f.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(f.ctrlKey&&s){const k=ii(f),w=T5(f),E=h*Math.pow(2,w);r.scaleTo(n,E,k,f);return}const p=f.deltaMode===1?20:1;let m=i===sa.Vertical?0:f.deltaX*p,y=i===sa.Horizontal?0:f.deltaY*p;!Xp()&&f.shiftKey&&i!==sa.Vertical&&(m=f.deltaY*p,y=0),r.translateBy(n,-(m/h)*o,-(y/h)*o,{internal:!0});const x=rg(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,a==null||a(f,x)),e.isPanScrolling&&(u==null||u(f,x),e.panScrollTimeout=setTimeout(()=>{c==null||c(f,x),e.isPanScrolling=!1},150))}}function Vpe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){if(!t&&r.type==="wheel"&&!r.ctrlKey||gl(r,e))return null;r.preventDefault(),n.call(this,r,i)}}function Wpe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,s,a;if((o=r.sourceEvent)!=null&&o.internal)return;const i=rg(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function Upe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{var s,a;e.usedRightMouseButton=!!(n&&N5(t,e.mouseButton??0)),(s=o.sourceEvent)!=null&&s.sync||r([o.transform.x,o.transform.y,o.transform.k]),i&&!((a=o.sourceEvent)!=null&&a.internal)&&(i==null||i(o.sourceEvent,rg(o.transform)))}}function Hpe({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:o}){return s=>{var a;if(!((a=s.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,o&&N5(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&o(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&$pe(e.prevViewport,s.transform))){const u=rg(s.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(s.sourceEvent,u)},n?150:0)}}}function Ype({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:a,noPanClassName:u,lib:c}){return f=>{var y;const h=e||t,p=n&&f.ctrlKey;if(f.button===1&&f.type==="mousedown"&&(gl(f,`${c}-flow__node`)||gl(f,`${c}-flow__edge`)))return!0;if(!r&&!h&&!i&&!o&&!n||s||gl(f,a)&&f.type==="wheel"||gl(f,u)&&(f.type!=="wheel"||i&&f.type==="wheel"&&!e)||!n&&f.ctrlKey&&f.type==="wheel")return!1;if(!n&&f.type==="touchstart"&&((y=f.touches)==null?void 0:y.length)>1)return f.preventDefault(),!1;if(!h&&!i&&!p&&f.type==="wheel"||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const m=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||f.type==="wheel")&&m}}function qpe({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:o,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:u,onDraggingChange:c}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),p=t5().clickDistance(!li(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),m=Sr(e).call(p);C({x:o.x,y:o.y,zoom:Yl(o.zoom,t,n)},[[0,0],[h.width,h.height]],i);const y=m.on("wheel.zoom"),x=m.on("dblclick.zoom");p.wheelDelta(T5);function k(F,H){return m?new Promise(I=>{p==null||p.transform(_x(m,H==null?void 0:H.duration,()=>I(!0)),F)}):Promise.resolve(!1)}function w({noWheelClassName:F,noPanClassName:H,onPaneContextMenu:I,userSelectionActive:Y,panOnScroll:q,panOnDrag:Z,panOnScrollMode:B,panOnScrollSpeed:W,preventScrolling:L,zoomOnPinch:U,zoomOnScroll:V,zoomOnDoubleClick:D,zoomActivationKeyPressed:G,lib:K,onTransformChange:J}){Y&&!f.isZoomingOrPanning&&E();const re=q&&!G&&!Y?Bpe({zoomPanValues:f,noWheelClassName:F,d3Selection:m,d3Zoom:p,panOnScrollMode:B,panOnScrollSpeed:W,zoomOnPinch:U,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:u}):Vpe({noWheelClassName:F,preventScrolling:L,d3ZoomHandler:y});if(m.on("wheel.zoom",re,{passive:!1}),!Y){const he=Wpe({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:a});p.on("start",he);const be=Upe({zoomPanValues:f,panOnDrag:Z,onPaneContextMenu:!!I,onPanZoom:s,onTransformChange:J});p.on("zoom",be);const fe=Hpe({zoomPanValues:f,panOnDrag:Z,panOnScroll:q,onPaneContextMenu:I,onPanZoomEnd:u,onDraggingChange:c});p.on("end",fe)}const ue=Ype({zoomActivationKeyPressed:G,panOnDrag:Z,zoomOnScroll:V,panOnScroll:q,zoomOnDoubleClick:D,zoomOnPinch:U,userSelectionActive:Y,noPanClassName:H,noWheelClassName:F,lib:K});p.filter(ue),D?m.on("dblclick.zoom",x):m.on("dblclick.zoom",null)}function E(){p.on("zoom",null)}async function C(F,H,I){const Y=Cx(F),q=p==null?void 0:p.constrain()(Y,H,I);return q&&await k(q),new Promise(Z=>Z(q))}async function N(F,H){const I=Cx(F);return await k(I,H),new Promise(Y=>Y(I))}function P(F){if(m){const H=Cx(F),I=m.property("__zoom");(I.k!==F.zoom||I.x!==F.x||I.y!==F.y)&&(p==null||p.transform(m,H,null,{sync:!0}))}}function A(){const F=m?e5(m.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function O(F,H){return m?new Promise(I=>{p==null||p.scaleTo(_x(m,H==null?void 0:H.duration,()=>I(!0)),F)}):Promise.resolve(!1)}function M(F,H){return m?new Promise(I=>{p==null||p.scaleBy(_x(m,H==null?void 0:H.duration,()=>I(!0)),F)}):Promise.resolve(!1)}function j(F){p==null||p.scaleExtent(F)}function R(F){p==null||p.translateExtent(F)}function $(F){const H=!li(F)||F<0?0:F;p==null||p.clickDistance(H)}return{update:w,destroy:E,setViewport:N,setViewportConstrained:C,getViewport:A,scaleTo:O,scaleBy:M,setScaleExtent:j,setTranslateExtent:R,syncViewport:P,setClickDistance:$}}var Oc;(function(e){e.Line="line",e.Handle="handle"})(Oc||(Oc={}));function Gpe({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:o}){const s=e-t,a=n-r,u=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&i&&(u[0]=u[0]*-1),a&&o&&(u[1]=u[1]*-1),u}function Zpe(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function ns(e,t){return Math.max(0,t-e)}function rs(e,t){return Math.max(0,e-t)}function zh(e,t,n){return Math.max(0,t-e,e-n)}function bA(e,t){return e?!t:t}function Kpe(e,t,n,r,i,o,s,a){let{affectsX:u,affectsY:c}=t;const{isHorizontal:f,isVertical:h}=t,p=f&&h,{xSnapped:m,ySnapped:y}=n,{minWidth:x,maxWidth:k,minHeight:w,maxHeight:E}=r,{x:C,y:N,width:P,height:A,aspectRatio:O}=e;let M=Math.floor(f?m-e.pointerX:0),j=Math.floor(h?y-e.pointerY:0);const R=P+(u?-M:M),$=A+(c?-j:j),F=-o[0]*P,H=-o[1]*A;let I=zh(R,x,k),Y=zh($,w,E);if(s){let B=0,W=0;u&&M<0?B=ns(C+M+F,s[0][0]):!u&&M>0&&(B=rs(C+R+F,s[1][0])),c&&j<0?W=ns(N+j+H,s[0][1]):!c&&j>0&&(W=rs(N+$+H,s[1][1])),I=Math.max(I,B),Y=Math.max(Y,W)}if(a){let B=0,W=0;u&&M>0?B=rs(C+M,a[0][0]):!u&&M<0&&(B=ns(C+R,a[1][0])),c&&j>0?W=rs(N+j,a[0][1]):!c&&j<0&&(W=ns(N+$,a[1][1])),I=Math.max(I,B),Y=Math.max(Y,W)}if(i){if(f){const B=zh(R/O,w,E)*O;if(I=Math.max(I,B),s){let W=0;!u&&!c||u&&!c&&p?W=rs(N+H+R/O,s[1][1])*O:W=ns(N+H+(u?M:-M)/O,s[0][1])*O,I=Math.max(I,W)}if(a){let W=0;!u&&!c||u&&!c&&p?W=ns(N+R/O,a[1][1])*O:W=rs(N+(u?M:-M)/O,a[0][1])*O,I=Math.max(I,W)}}if(h){const B=zh($*O,x,k)/O;if(Y=Math.max(Y,B),s){let W=0;!u&&!c||c&&!u&&p?W=rs(C+$*O+F,s[1][0])/O:W=ns(C+(c?j:-j)*O+F,s[0][0])/O,Y=Math.max(Y,W)}if(a){let W=0;!u&&!c||c&&!u&&p?W=ns(C+$*O,a[1][0])/O:W=rs(C+(c?j:-j)*O,a[0][0])/O,Y=Math.max(Y,W)}}}j=j+(j<0?Y:-Y),M=M+(M<0?I:-I),i&&(p?R>$*O?j=(bA(u,c)?-M:M)/O:M=(bA(u,c)?-j:j)*O:f?(j=M/O,c=u):(M=j*O,u=c));const q=u?C+M:C,Z=c?N+j:N;return{width:P+(u?-M:M),height:A+(c?-j:j),x:o[0]*M*(u?-1:1)+q,y:o[1]*j*(c?-1:1)+Z}}const A5={width:0,height:0,x:0,y:0},Xpe={...A5,pointerX:0,pointerY:0,aspectRatio:1};function Qpe(e){return[[0,0],[e.measured.width,e.measured.height]]}function Jpe(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,o=e.measured.width??0,s=e.measured.height??0,a=n[0]*o,u=n[1]*s;return[[r-a,i-u],[r+o-a,i+s-u]]}function eme({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const o=Sr(e);function s({controlPosition:u,boundaries:c,keepAspectRatio:f,onResizeStart:h,onResize:p,onResizeEnd:m,shouldResize:y}){let x={...A5},k={...Xpe};const w=Zpe(u);let E,C=null,N=[],P,A,O;const M=$4().on("start",j=>{const{nodeLookup:R,transform:$,snapGrid:F,snapToGrid:H,nodeOrigin:I,paneDomNode:Y}=n();if(E=R.get(t),!E)return;C=(Y==null?void 0:Y.getBoundingClientRect())??null;const{xSnapped:q,ySnapped:Z}=Dc(j.sourceEvent,{transform:$,snapGrid:F,snapToGrid:H,containerBounds:C});x={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},k={...x,pointerX:q,pointerY:Z,aspectRatio:x.width/x.height},P=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(P=R.get(E.parentId),A=P&&E.extent==="parent"?Qpe(P):void 0),N=[],O=void 0;for(const[B,W]of R)if(W.parentId===t&&(N.push({id:B,position:{...W.position},extent:W.extent}),W.extent==="parent"||W.expandParent)){const L=Jpe(W,E,W.origin??I);O?O=[[Math.min(L[0][0],O[0][0]),Math.min(L[0][1],O[0][1])],[Math.max(L[1][0],O[1][0]),Math.max(L[1][1],O[1][1])]]:O=L}h==null||h(j,{...x})}).on("drag",j=>{const{transform:R,snapGrid:$,snapToGrid:F,nodeOrigin:H}=n(),I=Dc(j.sourceEvent,{transform:R,snapGrid:$,snapToGrid:F,containerBounds:C}),Y=[];if(!E)return;const{x:q,y:Z,width:B,height:W}=x,L={},U=E.origin??H,{width:V,height:D,x:G,y:K}=Kpe(k,w,I,c,f,U,A,O),J=V!==B,ee=D!==W,re=G!==q&&J,ue=K!==Z&&ee;if(!re&&!ue&&!J&&!ee)return;if((re||ue||U[0]===1||U[1]===1)&&(L.x=re?G:x.x,L.y=ue?K:x.y,x.x=L.x,x.y=L.y,N.length>0)){const ve=G-q,Me=K-Z;for(const $e of N)$e.position={x:$e.position.x-ve+U[0]*(V-B),y:$e.position.y-Me+U[1]*(D-W)},Y.push($e)}if((J||ee)&&(L.width=J?V:x.width,L.height=ee?D:x.height,x.width=L.width,x.height=L.height),P&&E.expandParent){const ve=U[0]*(L.width??0);L.x&&L.x<ve&&(x.x=ve,k.x=k.x-(L.x-ve));const Me=U[1]*(L.height??0);L.y&&L.y<Me&&(x.y=Me,k.y=k.y-(L.y-Me))}const he=Gpe({width:x.width,prevWidth:B,height:x.height,prevHeight:W,affectsX:w.affectsX,affectsY:w.affectsY}),be={...x,direction:he};(y==null?void 0:y(j,be))!==!1&&(p==null||p(j,be),r(L,Y))}).on("end",j=>{m==null||m(j,{...x}),i==null||i()});o.call(M)}function a(){o.on(".drag",null)}return{update:s,destroy:a}}var Nx={exports:{}},Tx={},Ax={exports:{}},Px={};/**
368
+ * @license React
369
+ * use-sync-external-store-shim.production.min.js
370
+ *
371
+ * Copyright (c) Facebook, Inc. and its affiliates.
372
+ *
373
+ * This source code is licensed under the MIT license found in the
374
+ * LICENSE file in the root directory of this source tree.
375
+ */var kA;function tme(){if(kA)return Px;kA=1;var e=Kl();function t(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(h,p){var m=p(),y=r({inst:{value:m,getSnapshot:p}}),x=y[0].inst,k=y[1];return o(function(){x.value=m,x.getSnapshot=p,u(x)&&k({inst:x})},[h,m,p]),i(function(){return u(x)&&k({inst:x}),h(function(){u(x)&&k({inst:x})})},[h]),s(m),m}function u(h){var p=h.getSnapshot;h=h.value;try{var m=p();return!n(h,m)}catch{return!0}}function c(h,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Px.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Px}var SA;function nme(){return SA||(SA=1,Ax.exports=tme()),Ax.exports}/**
376
+ * @license React
377
+ * use-sync-external-store-shim/with-selector.production.min.js
378
+ *
379
+ * Copyright (c) Facebook, Inc. and its affiliates.
380
+ *
381
+ * This source code is licensed under the MIT license found in the
382
+ * LICENSE file in the root directory of this source tree.
383
+ */var EA;function rme(){if(EA)return Tx;EA=1;var e=Kl(),t=nme();function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,u=e.useDebugValue;return Tx.useSyncExternalStoreWithSelector=function(c,f,h,p,m){var y=o(null);if(y.current===null){var x={hasValue:!1,value:null};y.current=x}else x=y.current;y=a(function(){function w(A){if(!E){if(E=!0,C=A,A=p(A),m!==void 0&&x.hasValue){var O=x.value;if(m(O,A))return N=O}return N=A}if(O=N,r(C,A))return O;var M=p(A);return m!==void 0&&m(O,M)?O:(C=A,N=M)}var E=!1,C,N,P=h===void 0?null:h;return[function(){return w(f())},P===null?void 0:function(){return w(P())}]},[f,h,p,m]);var k=i(c,y[0],y[1]);return s(function(){x.hasValue=!0,x.value=k},[k]),u(k),k},Tx}var CA;function ime(){return CA||(CA=1,Nx.exports=rme()),Nx.exports}var ome=ime();const sme=Zl(ome),_A=e=>{let t;const n=new Set,r=(f,h)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const m=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,m))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>c,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{n.clear()}},c=t=e(r,i,u);return u},ame=e=>e?_A(e):_A,{useDebugValue:lme}=ne,{useSyncExternalStoreWithSelector:ume}=sme,cme=e=>e;function P5(e,t=cme,n){const r=ume(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return lme(r),r}const NA=(e,t)=>{const n=ame(e),r=(i,o=t)=>P5(n,i,o);return Object.assign(r,n),r},dme=(e,t)=>e?NA(e,t):NA;function nn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const ig=S.createContext(null),fme=ig.Provider,R5=Po.error001();function bt(e,t){const n=S.useContext(ig);if(n===null)throw new Error(R5);return P5(n,e,t)}function qt(){const e=S.useContext(ig);if(e===null)throw new Error(R5);return S.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const TA={display:"none"},hme={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},M5="react-flow__node-desc",D5="react-flow__edge-desc",pme="react-flow__aria-live",mme=e=>e.ariaLiveMessage;function gme({rfId:e}){const t=bt(mme);return v.jsx("div",{id:`${pme}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:hme,children:t})}function yme({rfId:e,disableKeyboardA11y:t}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{id:`${M5}-${e}`,style:TA,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),v.jsx("div",{id:`${D5}-${e}`,style:TA,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&v.jsx(gme,{rfId:e})]})}const vme=e=>e.userSelectionActive?"none":"all",Ok=S.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},o)=>{const s=bt(vme),a=`${e}`.split("-");return v.jsx("div",{className:gn(["react-flow__panel",n,...a]),style:{...r,pointerEvents:s},ref:o,...i,children:t})});function xme({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:v.jsx(Ok,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:v.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const wme=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},$h=e=>e.id;function bme(e,t){return nn(e.selectedNodes.map($h),t.selectedNodes.map($h))&&nn(e.selectedEdges.map($h),t.selectedEdges.map($h))}function kme({onSelectionChange:e}){const t=qt(),{selectedNodes:n,selectedEdges:r}=bt(wme,bme);return S.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(o=>o(i))},[n,r,e]),null}const Sme=e=>!!e.onSelectionChangeHandlers;function Eme({onSelectionChange:e}){const t=bt(Sme);return e||t?v.jsx(kme,{onSelectionChange:e}):null}const O5=[0,0],Cme={x:0,y:0,zoom:1},_me=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],AA=[..._me,"rfId"],Nme=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),PA={translateExtent:gd,nodeOrigin:O5,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function Tme(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:o,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:u,setPaneClickDistance:c}=bt(Nme,nn),f=qt();S.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{h.current=PA,a()}),[]);const h=S.useRef(PA);return S.useEffect(()=>{for(const p of AA){const m=e[p],y=h.current[p];m!==y&&(typeof e[p]>"u"||(p==="nodes"?t(m):p==="edges"?n(m):p==="minZoom"?r(m):p==="maxZoom"?i(m):p==="translateExtent"?o(m):p==="nodeExtent"?s(m):p==="paneClickDistance"?c(m):p==="fitView"?f.setState({fitViewOnInit:m}):p==="fitViewOptions"?f.setState({fitViewOnInitOptions:m}):f.setState({[p]:m})))}h.current=e},AA.map(p=>e[p])),null}function RA(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Ame(e){var r;const[t,n]=S.useState(e==="system"?null:e);return S.useEffect(()=>{if(e!=="system"){n(e);return}const i=RA(),o=()=>n(i!=null&&i.matches?"dark":"light");return o(),i==null||i.addEventListener("change",o),()=>{i==null||i.removeEventListener("change",o)}},[e]),t!==null?t:(r=RA())!=null&&r.matches?"dark":"light"}const MA=typeof document<"u"?document:null;function bd(e=null,t={target:MA,actInsideInputWithModifier:!0}){const[n,r]=S.useState(!1),i=S.useRef(!1),o=S.useRef(new Set([])),[s,a]=S.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace("+",`
384
+ `).replace(`
385
+
386
+ `,`
387
+ +`).split(`
388
+ `)),f=c.reduce((h,p)=>h.concat(...p),[]);return[c,f]}return[[],[]]},[e]);return S.useEffect(()=>{const u=(t==null?void 0:t.target)||MA;if(e!==null){const c=p=>{if(i.current=p.ctrlKey||p.metaKey||p.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&Jw(p))return!1;const y=OA(p.code,a);o.current.add(p[y]),DA(s,o.current,!1)&&(p.preventDefault(),r(!0))},f=p=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&Jw(p))return!1;const y=OA(p.code,a);DA(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(p[y]),p.key==="Meta"&&o.current.clear(),i.current=!1},h=()=>{o.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",c),u==null||u.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{u==null||u.removeEventListener("keydown",c),u==null||u.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function DA(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function OA(e,t){return t.includes(e)?"code":"key"}const Pme=()=>{const e=qt();return S.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,o],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??o},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>{const{nodeLookup:n,minZoom:r,maxZoom:i,panZoom:o,domNode:s}=e.getState();if(!o||!s)return Promise.resolve(!1);const a=Kw(n,t),{width:u,height:c}=ng(s);return Xw({nodes:a,width:u,height:c,minZoom:r,maxZoom:i,panZoom:o},t)},setCenter:async(t,n,r)=>{const{width:i,height:o,maxZoom:s,panZoom:a}=e.getState(),u=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:s,c=i/2-t*u,f=o/2-n*u;return a?(await a.setViewport({x:c,y:f,zoom:u},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:o,maxZoom:s,panZoom:a}=e.getState(),u=Ak(t,r,i,o,s,(n==null?void 0:n.padding)??.1);return a?(await a.setViewport(u,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:r,snapGrid:i,domNode:o}=e.getState();if(!o)return t;const{x:s,y:a}=o.getBoundingClientRect(),u={x:t.x-s,y:t.y-a};return nf(u,r,n.snapToGrid,i)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:o}=r.getBoundingClientRect(),s=d5(t,n);return{x:s.x+i,y:s.y+o}}}),[])};function I5(e,t){const n=[],r=new Map,i=[];for(const o of e)if(o.type==="add"){i.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const s=r.get(o.id);s?s.push(o):r.set(o.id,[o])}for(const o of t){const s=r.get(o.id);if(!s){n.push(o);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...o};for(const u of s)Rme(u,a);n.push(a)}return i.length&&i.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function Rme(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function j5(e,t){return I5(e,t)}function L5(e,t){return I5(e,t)}function Zs(e,t){return{id:e,type:"select",selected:t}}function yl(e,t=new Set,n=!1){const r=[];for(const[i,o]of e){const s=t.has(i);!(o.selected===void 0&&!s)&&o.selected!==s&&(n&&(o.selected=s),r.push(Zs(o.id,s)))}return r}function IA({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,s]of e.entries()){const a=t.get(s.id),u=((i=a==null?void 0:a.internals)==null?void 0:i.userNode)??a;u!==void 0&&u!==s&&n.push({id:s.id,item:s,type:"replace"}),u===void 0&&n.push({item:s,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function jA(e){return{id:e.id,type:"remove"}}const LA=e=>cpe(e),Mme=e=>o5(e);function F5(e){return S.forwardRef(e)}const Dme=typeof window<"u"?S.useLayoutEffect:S.useEffect;function FA(e){const[t,n]=S.useState(BigInt(0)),[r]=S.useState(()=>Ome(()=>n(i=>i+BigInt(1))));return Dme(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function Ome(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const z5=S.createContext(null);function Ime({children:e}){const t=qt(),n=S.useCallback(a=>{const{nodes:u=[],setNodes:c,hasDefaultNodes:f,onNodesChange:h,nodeLookup:p}=t.getState();let m=u;for(const y of a)m=typeof y=="function"?y(m):y;f?c(m):h&&h(IA({items:m,lookup:p}))},[]),r=FA(n),i=S.useCallback(a=>{const{edges:u=[],setEdges:c,hasDefaultEdges:f,onEdgesChange:h,edgeLookup:p}=t.getState();let m=u;for(const y of a)m=typeof y=="function"?y(m):y;f?c(m):h&&h(IA({items:m,lookup:p}))},[]),o=FA(i),s=S.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return v.jsx(z5.Provider,{value:s,children:e})}function jme(){const e=S.useContext(z5);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Lme=e=>!!e.panZoom;function Ik(){const e=Pme(),t=qt(),n=jme(),r=bt(Lme),i=S.useMemo(()=>{const o=h=>t.getState().nodeLookup.get(h),s=h=>{n.nodeQueue.push(h)},a=h=>{n.edgeQueue.push(h)},u=h=>{var w,E;const{nodeLookup:p,nodeOrigin:m}=t.getState(),y=LA(h)?h:p.get(h.id),x=y.parentId?h5(y.position,y.measured,y.parentId,p,m):y.position,k={...y,position:x,width:((w=y.measured)==null?void 0:w.width)??y.width,height:((E=y.measured)==null?void 0:E.height)??y.height};return ql(k)},c=(h,p,m={replace:!1})=>{s(y=>y.map(x=>{if(x.id===h){const k=typeof p=="function"?p(x):p;return m.replace&&LA(k)?k:{...x,...k}}return x}))},f=(h,p,m={replace:!1})=>{a(y=>y.map(x=>{if(x.id===h){const k=typeof p=="function"?p(x):p;return m.replace&&Mme(k)?k:{...x,...k}}return x}))};return{getNodes:()=>t.getState().nodes.map(h=>({...h})),getNode:h=>{var p;return(p=o(h))==null?void 0:p.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:h=[]}=t.getState();return h.map(p=>({...p}))},getEdge:h=>t.getState().edgeLookup.get(h),setNodes:s,setEdges:a,addNodes:h=>{const p=Array.isArray(h)?h:[h];n.nodeQueue.push(m=>[...m,...p])},addEdges:h=>{const p=Array.isArray(h)?h:[h];n.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:h=[],edges:p=[],transform:m}=t.getState(),[y,x,k]=m;return{nodes:h.map(w=>({...w})),edges:p.map(w=>({...w})),viewport:{x:y,y:x,zoom:k}}},deleteElements:async({nodes:h=[],edges:p=[]})=>{const{nodes:m,edges:y,onNodesDelete:x,onEdgesDelete:k,triggerNodeChanges:w,triggerEdgeChanges:E,onDelete:C,onBeforeDelete:N}=t.getState(),{nodes:P,edges:A}=await hpe({nodesToRemove:h,edgesToRemove:p,nodes:m,edges:y,onBeforeDelete:N}),O=A.length>0,M=P.length>0;if(O){const j=A.map(jA);k==null||k(A),E(j)}if(M){const j=P.map(jA);x==null||x(P),w(j)}return(M||O)&&(C==null||C({nodes:P,edges:A})),{deletedNodes:P,deletedEdges:A}},getIntersectingNodes:(h,p=!0,m)=>{const y=fA(h),x=y?h:u(h),k=m!==void 0;return x?(m||t.getState().nodes).filter(w=>{const E=t.getState().nodeLookup.get(w.id);if(E&&!y&&(w.id===h.id||!E.internals.positionAbsolute))return!1;const C=ql(k?w:E),N=xd(C,x);return p&&N>0||N>=x.width*x.height}):[]},isNodeIntersecting:(h,p,m=!0)=>{const x=fA(h)?h:u(h);if(!x)return!1;const k=xd(x,p);return m&&k>0||k>=x.width*x.height},updateNode:c,updateNodeData:(h,p,m={replace:!1})=>{c(h,y=>{const x=typeof p=="function"?p(y):p;return m.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},m)},updateEdge:f,updateEdgeData:(h,p,m={replace:!1})=>{f(h,y=>{const x=typeof p=="function"?p(y):p;return m.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},m)},getNodesBounds:h=>{const{nodeLookup:p,nodeOrigin:m}=t.getState();return dpe(h,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:h,id:p,nodeId:m})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${m}-${h}-${p??null}`))==null?void 0:y.values())??[])}}},[]);return S.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const zA=e=>e.selected,Fme={actInsideInputWithModifier:!1},zme=typeof window<"u"?window:void 0;function $me({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=qt(),{deleteElements:r}=Ik(),i=bd(e,Fme),o=bd(t,{target:zme});S.useEffect(()=>{if(i){const{edges:s,nodes:a}=n.getState();r({nodes:a.filter(zA),edges:s.filter(zA)}),n.setState({nodesSelectionActive:!1})}},[i]),S.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function Bme(e){const t=qt();S.useEffect(()=>{const n=()=>{var i,o;if(!e.current)return!1;const r=ng(e.current);(r.height===0||r.width===0)&&((o=(i=t.getState()).onError)==null||o.call(i,"004",Po.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const og={position:"absolute",width:"100%",height:"100%",top:0,left:0},Vme=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function Wme({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:o=sa.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:u,translateExtent:c,minZoom:f,maxZoom:h,zoomActivationKeyCode:p,preventScrolling:m=!0,children:y,noWheelClassName:x,noPanClassName:k,onViewportChange:w,isControlledViewport:E,paneClickDistance:C}){const N=qt(),P=S.useRef(null),{userSelectionActive:A,lib:O}=bt(Vme,nn),M=bd(p),j=S.useRef();Bme(P);const R=S.useCallback($=>{w==null||w({x:$[0],y:$[1],zoom:$[2]}),E||N.setState({transform:$})},[w,E]);return S.useEffect(()=>{if(P.current){j.current=qpe({domNode:P.current,minZoom:f,maxZoom:h,translateExtent:c,viewport:u,paneClickDistance:C,onDraggingChange:I=>N.setState({paneDragging:I}),onPanZoomStart:(I,Y)=>{const{onViewportChangeStart:q,onMoveStart:Z}=N.getState();Z==null||Z(I,Y),q==null||q(Y)},onPanZoom:(I,Y)=>{const{onViewportChange:q,onMove:Z}=N.getState();Z==null||Z(I,Y),q==null||q(Y)},onPanZoomEnd:(I,Y)=>{const{onViewportChangeEnd:q,onMoveEnd:Z}=N.getState();Z==null||Z(I,Y),q==null||q(Y)}});const{x:$,y:F,zoom:H}=j.current.getViewport();return N.setState({panZoom:j.current,transform:[$,F,H],domNode:P.current.closest(".react-flow")}),()=>{var I;(I=j.current)==null||I.destroy()}}},[]),S.useEffect(()=>{var $;($=j.current)==null||$.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:M,preventScrolling:m,noPanClassName:k,userSelectionActive:A,noWheelClassName:x,lib:O,onTransformChange:R})},[e,t,n,r,i,o,s,a,M,m,k,A,x,O,R]),v.jsx("div",{className:"react-flow__renderer",ref:P,style:og,children:y})}const Ume=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Hme(){const{userSelectionActive:e,userSelectionRect:t}=bt(Ume,nn);return e&&t?v.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Rx=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Yme=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function qme({isSelecting:e,selectionKeyPressed:t,selectionMode:n=yd.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:o,onSelectionEnd:s,onPaneClick:a,onPaneContextMenu:u,onPaneScroll:c,onPaneMouseEnter:f,onPaneMouseMove:h,onPaneMouseLeave:p,children:m}){const y=S.useRef(null),x=qt(),k=S.useRef(0),w=S.useRef(0),E=S.useRef(),C=S.useRef(new Map),{userSelectionActive:N,elementsSelectable:P,dragging:A}=bt(Yme,nn),O=P&&(e||N),M=S.useRef(!1),j=S.useRef(!1),R=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),k.current=0,w.current=0},$=B=>{if(M.current){M.current=!1;return}a==null||a(B),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},F=B=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){B.preventDefault();return}u==null||u(B)},H=c?B=>c(B):void 0,I=B=>{var G,K,J,ee;const{resetSelectedElements:W,domNode:L,edgeLookup:U}=x.getState();if(E.current=L==null?void 0:L.getBoundingClientRect(),!P||!e||B.button!==0||B.target!==y.current||!E.current)return;(K=(G=B.target)==null?void 0:G.setPointerCapture)==null||K.call(G,B.pointerId),j.current=!0,M.current=!1,C.current=new Map;for(const[re,ue]of U)C.current.set(ue.source,((J=C.current.get(ue.source))==null?void 0:J.add(re))||new Set([re])),C.current.set(ue.target,((ee=C.current.get(ue.target))==null?void 0:ee.add(re))||new Set([re]));const{x:V,y:D}=yo(B.nativeEvent,E.current);W(),x.setState({userSelectionRect:{width:0,height:0,startX:V,startY:D,x:V,y:D}}),o==null||o(B)},Y=B=>{const{userSelectionRect:W,edgeLookup:L,transform:U,nodeLookup:V,triggerNodeChanges:D,triggerEdgeChanges:G}=x.getState();if(!E.current||!W)return;M.current=!0;const{x:K,y:J}=yo(B.nativeEvent,E.current),{startX:ee,startY:re}=W,ue={startX:ee,startY:re,x:K<ee?K:ee,y:J<re?J:re,width:Math.abs(K-ee),height:Math.abs(J-re)},he=s5(V,ue,U,n===yd.Partial,!0),be=new Set,fe=new Set;for(const ve of he){fe.add(ve.id);const Me=C.current.get(ve.id);if(Me)for(const $e of Me)be.add($e)}if(k.current!==fe.size){k.current=fe.size;const ve=yl(V,fe,!0);D(ve)}if(w.current!==be.size){w.current=be.size;const ve=yl(L,be);G(ve)}x.setState({userSelectionRect:ue,userSelectionActive:!0,nodesSelectionActive:!1})},q=B=>{var L,U;if(B.button!==0||!j.current)return;(U=(L=B.target)==null?void 0:L.releasePointerCapture)==null||U.call(L,B.pointerId);const{userSelectionRect:W}=x.getState();!N&&W&&B.target===y.current&&($==null||$(B)),k.current>0&&x.setState({nodesSelectionActive:!0}),R(),s==null||s(B),(t||i)&&(M.current=!1),j.current=!1},Z=r===!0||Array.isArray(r)&&r.includes(0);return v.jsxs("div",{className:gn(["react-flow__pane",{draggable:Z,dragging:A,selection:e}]),onClick:O?void 0:Rx($,y),onContextMenu:Rx(F,y),onWheel:Rx(H,y),onPointerEnter:O?void 0:f,onPointerDown:O?I:h,onPointerMove:O?Y:h,onPointerUp:O?q:void 0,onPointerLeave:p,ref:y,style:og,children:[m,v.jsx(Hme,{})]})}function ib({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeLookup:a,onError:u}=t.getState(),c=a.get(e);if(!c){u==null||u("012",Po.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var f;return(f=r==null?void 0:r.current)==null?void 0:f.blur()})):i([e])}function $5({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,nodeClickDistance:s}){const a=qt(),[u,c]=S.useState(!1),f=S.useRef();return S.useEffect(()=>{f.current=Dpe({getStoreItems:()=>a.getState(),onNodeMouseDown:h=>{ib({id:h,store:a,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),S.useEffect(()=>{var h,p;if(t)(h=f.current)==null||h.destroy();else if(e.current)return(p=f.current)==null||p.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:i,nodeClickDistance:s}),()=>{var m;(m=f.current)==null||m.destroy()}},[n,r,t,o,e,i]),u}const Gme=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function B5(){const e=qt();return S.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:o,nodesDraggable:s,onError:a,updateNodePositions:u,nodeLookup:c,nodeOrigin:f}=e.getState(),h=new Map,p=Gme(s),m=i?o[0]:5,y=i?o[1]:5,x=n.direction.x*m*n.factor,k=n.direction.y*y*n.factor;for(const[,w]of c){if(!p(w))continue;let E={x:w.internals.positionAbsolute.x+x,y:w.internals.positionAbsolute.y+k};i&&(E=tg(E,o));const{position:C,positionAbsolute:N}=a5({nodeId:w.id,nextPosition:E,nodeLookup:c,nodeExtent:r,nodeOrigin:f,onError:a});w.position=C,w.internals.positionAbsolute=N,h.set(w.id,w)}u(h)},[])}const jk=S.createContext(null),Zme=jk.Provider;jk.Consumer;const V5=()=>S.useContext(jk),Kme=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Xme=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:o,connection:s}=r,{fromHandle:a,toHandle:u,isValid:c}=s,f=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,connectingTo:f,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:o===Hl.Strict?(a==null?void 0:a.type)!==n:e!==(a==null?void 0:a.nodeId)||t!==(a==null?void 0:a.id),connectionInProcess:!!a,valid:f&&c}};function Qme({type:e="source",position:t=We.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:a,children:u,className:c,onMouseDown:f,onTouchStart:h,...p},m){var I,Y;const y=s||null,x=e==="target",k=qt(),w=V5(),{connectOnClick:E,noPanClassName:C,rfId:N}=bt(Kme,nn),{connectingFrom:P,connectingTo:A,clickConnecting:O,isPossibleEndHandle:M,connectionInProcess:j,valid:R}=bt(Xme(w,y,e),nn);w||(Y=(I=k.getState()).onError)==null||Y.call(I,"010",Po.error010());const $=q=>{const{defaultEdgeOptions:Z,onConnect:B,hasDefaultEdges:W}=k.getState(),L={...Z,...q};if(W){const{edges:U,setEdges:V}=k.getState();V(wpe(L,U))}B==null||B(L),a==null||a(L)},F=q=>{if(!w)return;const Z=m5(q.nativeEvent);if(i&&(Z&&q.button===0||!Z)){const B=k.getState();rb.onPointerDown(q.nativeEvent,{autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:x,handleId:y,nodeId:w,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:B.onConnectEnd,updateConnection:B.updateConnection,onConnect:$,isValidConnection:n||B.isValidConnection,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed})}Z?f==null||f(q):h==null||h(q)},H=q=>{const{onClickConnectStart:Z,onClickConnectEnd:B,connectionClickStartHandle:W,connectionMode:L,isValidConnection:U,lib:V,rfId:D,nodeLookup:G,connection:K}=k.getState();if(!w||!W&&!i)return;if(!W){Z==null||Z(q.nativeEvent,{nodeId:w,handleId:y,handleType:e}),k.setState({connectionClickStartHandle:{nodeId:w,type:e,id:y}});return}const J=p5(q.target),ee=n||U,{connection:re,isValid:ue}=rb.isValid(q.nativeEvent,{handle:{nodeId:w,id:y,type:e},connectionMode:L,fromNodeId:W.nodeId,fromHandleId:W.id||null,fromType:W.type,isValidConnection:ee,flowId:D,doc:J,lib:V,nodeLookup:G});ue&&re&&$(re);const he=structuredClone(K);delete he.inProgress,he.toPosition=he.toHandle?he.toHandle.position:null,B==null||B(q,he),k.setState({connectionClickStartHandle:null})};return v.jsx("div",{"data-handleid":y,"data-nodeid":w,"data-handlepos":t,"data-id":`${N}-${w}-${y}-${e}`,className:gn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",C,c,{source:!x,target:x,connectable:r,connectablestart:i,connectableend:o,clickconnecting:O,connectingfrom:P,connectingto:A,valid:R,connectionindicator:r&&(!j||M)&&(j?o:i)}]),onMouseDown:F,onTouchStart:F,onClick:E?H:void 0,ref:m,...p,children:u})}const bs=S.memo(F5(Qme));function Jme({data:e,isConnectable:t,sourcePosition:n=We.Bottom}){return v.jsxs(v.Fragment,{children:[e==null?void 0:e.label,v.jsx(bs,{type:"source",position:n,isConnectable:t})]})}function ege({data:e,isConnectable:t,targetPosition:n=We.Top,sourcePosition:r=We.Bottom}){return v.jsxs(v.Fragment,{children:[v.jsx(bs,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,v.jsx(bs,{type:"source",position:r,isConnectable:t})]})}function tge(){return null}function nge({data:e,isConnectable:t,targetPosition:n=We.Top}){return v.jsxs(v.Fragment,{children:[v.jsx(bs,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Qp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},$A={input:Jme,default:ege,output:nge,group:tge};function rge(e){var t,n,r,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const ige=e=>{const{width:t,height:n,x:r,y:i}=tf(e.nodeLookup,{filter:o=>!!o.selected});return{width:li(t)?t:null,height:li(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function oge({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=qt(),{width:i,height:o,transformString:s,userSelectionActive:a}=bt(ige,nn),u=B5(),c=S.useRef(null);if(S.useEffect(()=>{var p;n||(p=c.current)==null||p.focus({preventScroll:!0})},[n]),$5({nodeRef:c}),a||!i||!o)return null;const f=e?p=>{const m=r.getState().nodes.filter(y=>y.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Qp,p.key)&&(p.preventDefault(),u({direction:Qp[p.key],factor:p.shiftKey?4:1}))};return v.jsx("div",{className:gn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:v.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:o}})})}const BA=typeof window<"u"?window:void 0,sge=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function W5({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:u,selectionKeyCode:c,selectionOnDrag:f,selectionMode:h,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:y,panActivationKeyCode:x,zoomActivationKeyCode:k,elementsSelectable:w,zoomOnScroll:E,zoomOnPinch:C,panOnScroll:N,panOnScrollSpeed:P,panOnScrollMode:A,zoomOnDoubleClick:O,panOnDrag:M,defaultViewport:j,translateExtent:R,minZoom:$,maxZoom:F,preventScrolling:H,onSelectionContextMenu:I,noWheelClassName:Y,noPanClassName:q,disableKeyboardA11y:Z,onViewportChange:B,isControlledViewport:W}){const{nodesSelectionActive:L,userSelectionActive:U}=bt(sge),V=bd(c,{target:BA}),D=bd(x,{target:BA}),G=D||M,K=D||N,J=f&&G!==!0,ee=V||U||J;return $me({deleteKeyCode:u,multiSelectionKeyCode:y}),v.jsx(Wme,{onPaneContextMenu:o,elementsSelectable:w,zoomOnScroll:E,zoomOnPinch:C,panOnScroll:K,panOnScrollSpeed:P,panOnScrollMode:A,zoomOnDoubleClick:O,panOnDrag:!V&&G,defaultViewport:j,translateExtent:R,minZoom:$,maxZoom:F,zoomActivationKeyCode:k,preventScrolling:H,noWheelClassName:Y,noPanClassName:q,onViewportChange:B,isControlledViewport:W,paneClickDistance:a,children:v.jsxs(qme,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:G,isSelecting:!!ee,selectionMode:h,selectionKeyPressed:V,selectionOnDrag:J,children:[e,L&&v.jsx(oge,{onSelectionContextMenu:I,noPanClassName:q,disableKeyboardA11y:Z})]})})}W5.displayName="FlowRenderer";const age=S.memo(W5),lge=e=>t=>e?s5(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function uge(e){return bt(S.useCallback(lge(e),[e]),nn)}const cge=e=>e.updateNodeInternals;function dge(){const e=bt(cge),[t]=S.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const o=i.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:i.target,force:!0})}),e(r)}));return S.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function fge({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=qt(),o=S.useRef(null),s=S.useRef(null),a=S.useRef(e.sourcePosition),u=S.useRef(e.targetPosition),c=S.useRef(t),f=n&&!!e.internals.handleBounds;return S.useEffect(()=>{o.current&&!e.hidden&&(!f||s.current!==o.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(o.current),s.current=o.current)},[f,e.hidden]),S.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),S.useEffect(()=>{if(o.current){const h=c.current!==t,p=a.current!==e.sourcePosition,m=u.current!==e.targetPosition;(h||p||m)&&(c.current=t,a.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function hge({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:o,onDoubleClick:s,nodesDraggable:a,elementsSelectable:u,nodesConnectable:c,nodesFocusable:f,resizeObserver:h,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:y,rfId:x,nodeTypes:k,nodeExtent:w,nodeClickDistance:E,onError:C}){const{node:N,internals:P,isParent:A}=bt(re=>{const ue=re.nodeLookup.get(e),he=re.parentLookup.has(e);return{node:ue,internals:ue.internals,isParent:he}},nn);let O=N.type||"default",M=(k==null?void 0:k[O])||$A[O];M===void 0&&(C==null||C("003",Po.error003(O)),O="default",M=$A.default);const j=!!(N.draggable||a&&typeof N.draggable>"u"),R=!!(N.selectable||u&&typeof N.selectable>"u"),$=!!(N.connectable||c&&typeof N.connectable>"u"),F=!!(N.focusable||f&&typeof N.focusable>"u"),H=qt(),I=f5(N),Y=fge({node:N,nodeType:O,hasDimensions:I,resizeObserver:h}),q=$5({nodeRef:Y,disabled:N.hidden||!j,noDragClassName:p,handleSelector:N.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:E}),Z=B5();if(N.hidden)return null;const B=Ro(N),W=rge(N),L=R||j||t||n||r||i,U=n?re=>n(re,{...P.userNode}):void 0,V=r?re=>r(re,{...P.userNode}):void 0,D=i?re=>i(re,{...P.userNode}):void 0,G=o?re=>o(re,{...P.userNode}):void 0,K=s?re=>s(re,{...P.userNode}):void 0,J=re=>{const{selectNodesOnDrag:ue,nodeDragThreshold:he}=H.getState();R&&(!ue||!j||he>0)&&ib({id:e,store:H,nodeRef:Y}),t&&t(re,{...P.userNode})},ee=re=>{if(!(Jw(re.nativeEvent)||y))if(n5.includes(re.key)&&R){const ue=re.key==="Escape";ib({id:e,store:H,unselect:ue,nodeRef:Y})}else j&&N.selected&&Object.prototype.hasOwnProperty.call(Qp,re.key)&&(re.preventDefault(),H.setState({ariaLiveMessage:`Moved selected node ${re.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~P.positionAbsolute.x}, y: ${~~P.positionAbsolute.y}`}),Z({direction:Qp[re.key],factor:re.shiftKey?4:1}))};return v.jsx("div",{className:gn(["react-flow__node",`react-flow__node-${O}`,{[m]:j},N.className,{selected:N.selected,selectable:R,parent:A,draggable:j,dragging:q}]),ref:Y,style:{zIndex:P.z,transform:`translate(${P.positionAbsolute.x}px,${P.positionAbsolute.y}px)`,pointerEvents:L?"all":"none",visibility:I?"visible":"hidden",...N.style,...W},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:U,onMouseMove:V,onMouseLeave:D,onContextMenu:G,onClick:J,onDoubleClick:K,onKeyDown:F?ee:void 0,tabIndex:F?0:void 0,role:F?"button":void 0,"aria-describedby":y?void 0:`${M5}-${x}`,"aria-label":N.ariaLabel,children:v.jsx(Zme,{value:e,children:v.jsx(M,{id:e,data:N.data,type:O,positionAbsoluteX:P.positionAbsolute.x,positionAbsoluteY:P.positionAbsolute.y,selected:N.selected,selectable:R,draggable:j,deletable:N.deletable??!0,isConnectable:$,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:q,dragHandle:N.dragHandle,zIndex:P.z,parentId:N.parentId,...B})})})}const pge=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function U5(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:o}=bt(pge,nn),s=uge(e.onlyRenderVisibleElements),a=dge();return v.jsx("div",{className:"react-flow__nodes",style:og,children:s.map(u=>v.jsx(hge,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:o},u))})}U5.displayName="NodeRenderer";const mge=S.memo(U5);function gge(e){return bt(S.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const o=n.nodeLookup.get(i.source),s=n.nodeLookup.get(i.target);o&&s&&ype({sourceNode:o,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),nn)}const yge=({color:e="none",strokeWidth:t=1})=>v.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),vge=({color:e="none",strokeWidth:t=1})=>v.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),VA={[vd.Arrow]:yge,[vd.ArrowClosed]:vge};function xge(e){const t=qt();return S.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(VA,e)?VA[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",Po.error009(e)),null)},[e])}const wge=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const u=xge(t);return u?v.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:v.jsx(u,{color:n,strokeWidth:s})}):null},H5=({defaultColor:e,rfId:t})=>{const n=bt(o=>o.edges),r=bt(o=>o.defaultEdgeOptions),i=S.useMemo(()=>Cpe(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?v.jsx("svg",{className:"react-flow__marker",children:v.jsx("defs",{children:i.map(o=>v.jsx(wge,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};H5.displayName="MarkerDefinitions";var bge=S.memo(H5);function Y5({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:u,className:c,...f}){const[h,p]=S.useState({x:1,y:0,width:0,height:0}),m=gn(["react-flow__edge-textwrapper",c]),y=S.useRef(null);return S.useEffect(()=>{if(y.current){const x=y.current.getBBox();p({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),typeof n>"u"||!n?null:v.jsxs("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:m,visibility:h.width?"visible":"hidden",...f,children:[i&&v.jsx("rect",{width:h.width+2*s[0],x:-s[0],y:-s[1],height:h.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),v.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:y,style:r,children:n}),u]})}Y5.displayName="EdgeText";const kge=S.memo(Y5);function sg({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u,interactionWidth:c=20,...f}){return v.jsxs(v.Fragment,{children:[v.jsx("path",{...f,d:e,fill:"none",className:gn(["react-flow__edge-path",f.className])}),c&&v.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}),r&&li(t)&&li(n)?v.jsx(kge,{x:t,y:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:u}):null]})}function WA({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===We.Left||e===We.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function q5({sourceX:e,sourceY:t,sourcePosition:n=We.Bottom,targetX:r,targetY:i,targetPosition:o=We.Top}){const[s,a]=WA({pos:n,x1:e,y1:t,x2:r,y2:i}),[u,c]=WA({pos:o,x1:r,y1:i,x2:e,y2:t}),[f,h,p,m]=g5({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${s},${a} ${u},${c} ${r},${i}`,f,h,p,m]}function G5(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s=We.Bottom,targetPosition:a=We.Top,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:k,interactionWidth:w})=>{const[E,C,N]=q5({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:a}),P=e.isInternal?void 0:t;return v.jsx(sg,{id:P,path:E,labelX:C,labelY:N,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:k,interactionWidth:w})})}const Sge=G5({isInternal:!1}),Z5=G5({isInternal:!0});Sge.displayName="SimpleBezierEdge";Z5.displayName="SimpleBezierEdgeInternal";function K5(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:p,sourcePosition:m=We.Bottom,targetPosition:y=We.Top,markerEnd:x,markerStart:k,pathOptions:w,interactionWidth:E})=>{const[C,N,P]=eb({sourceX:n,sourceY:r,sourcePosition:m,targetX:i,targetY:o,targetPosition:y,borderRadius:w==null?void 0:w.borderRadius,offset:w==null?void 0:w.offset}),A=e.isInternal?void 0:t;return v.jsx(sg,{id:A,path:C,labelX:N,labelY:P,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:x,markerStart:k,interactionWidth:E})})}const X5=K5({isInternal:!1}),Q5=K5({isInternal:!0});X5.displayName="SmoothStepEdge";Q5.displayName="SmoothStepEdgeInternal";function J5(e){return S.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return v.jsx(X5,{...n,id:r,pathOptions:S.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const Ege=J5({isInternal:!1}),e3=J5({isInternal:!0});Ege.displayName="StepEdge";e3.displayName="StepEdgeInternal";function t3(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:y,interactionWidth:x})=>{const[k,w,E]=x5({sourceX:n,sourceY:r,targetX:i,targetY:o}),C=e.isInternal?void 0:t;return v.jsx(sg,{id:C,path:k,labelX:w,labelY:E,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:y,interactionWidth:x})})}const Cge=t3({isInternal:!1}),n3=t3({isInternal:!0});Cge.displayName="StraightEdge";n3.displayName="StraightEdgeInternal";function r3(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:s=We.Bottom,targetPosition:a=We.Top,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:k,pathOptions:w,interactionWidth:E})=>{const[C,N,P]=y5({sourceX:n,sourceY:r,sourcePosition:s,targetX:i,targetY:o,targetPosition:a,curvature:w==null?void 0:w.curvature}),A=e.isInternal?void 0:t;return v.jsx(sg,{id:A,path:C,labelX:N,labelY:P,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:k,interactionWidth:E})})}const _ge=r3({isInternal:!1}),i3=r3({isInternal:!0});_ge.displayName="BezierEdge";i3.displayName="BezierEdgeInternal";const UA={default:i3,straight:n3,step:e3,smoothstep:Q5,simplebezier:Z5},HA={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Nge=(e,t,n)=>n===We.Left?e-t:n===We.Right?e+t:e,Tge=(e,t,n)=>n===We.Top?e-t:n===We.Bottom?e+t:e,YA="react-flow__edgeupdater";function qA({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:a}){return v.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:gn([YA,`${YA}-${a}`]),cx:Nge(t,r,e),cy:Tge(n,r,e),r,stroke:"transparent",fill:"transparent"})}function Age({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:o,targetY:s,sourcePosition:a,targetPosition:u,onReconnect:c,onReconnectStart:f,onReconnectEnd:h,setReconnecting:p,setUpdateHover:m}){const y=qt(),x=(N,P)=>{if(N.button!==0)return;const{autoPanOnConnect:A,domNode:O,isValidConnection:M,connectionMode:j,connectionRadius:R,lib:$,onConnectStart:F,onConnectEnd:H,cancelConnection:I,nodeLookup:Y,rfId:q,panBy:Z,updateConnection:B}=y.getState(),W=P.type==="target";p(!0),f==null||f(N,n,P.type);const L=(V,D)=>{p(!1),h==null||h(V,n,P.type,D)},U=V=>c==null?void 0:c(n,V);rb.onPointerDown(N.nativeEvent,{autoPanOnConnect:A,connectionMode:j,connectionRadius:R,domNode:O,handleId:P.id,nodeId:P.nodeId,nodeLookup:Y,isTarget:W,edgeUpdaterType:P.type,lib:$,flowId:q,cancelConnection:I,panBy:Z,isValidConnection:M,onConnect:U,onConnectStart:F,onConnectEnd:H,onReconnectEnd:L,updateConnection:B,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle})},k=N=>x(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),w=N=>x(N,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),E=()=>m(!0),C=()=>m(!1);return v.jsxs(v.Fragment,{children:[(e===!0||e==="source")&&v.jsx(qA,{position:a,centerX:r,centerY:i,radius:t,onMouseDown:k,onMouseEnter:E,onMouseOut:C,type:"source"}),(e===!0||e==="target")&&v.jsx(qA,{position:u,centerX:o,centerY:s,radius:t,onMouseDown:w,onMouseEnter:E,onMouseOut:C,type:"target"})]})}function Pge({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:o,onContextMenu:s,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,reconnectRadius:f,onReconnect:h,onReconnectStart:p,onReconnectEnd:m,rfId:y,edgeTypes:x,noPanClassName:k,onError:w,disableKeyboardA11y:E}){let C=bt(fe=>fe.edgeLookup.get(e));const N=bt(fe=>fe.defaultEdgeOptions);C=N?{...N,...C}:C;let P=C.type||"default",A=(x==null?void 0:x[P])||UA[P];A===void 0&&(w==null||w("011",Po.error011(P)),P="default",A=UA.default);const O=!!(C.focusable||t&&typeof C.focusable>"u"),M=typeof h<"u"&&(C.reconnectable||n&&typeof C.reconnectable>"u"),j=!!(C.selectable||r&&typeof C.selectable>"u"),R=S.useRef(null),[$,F]=S.useState(!1),[H,I]=S.useState(!1),Y=qt(),{zIndex:q,sourceX:Z,sourceY:B,targetX:W,targetY:L,sourcePosition:U,targetPosition:V}=bt(S.useCallback(fe=>{const ve=fe.nodeLookup.get(C.source),Me=fe.nodeLookup.get(C.target);if(!ve||!Me)return{zIndex:C.zIndex,...HA};const $e=Epe({id:e,sourceNode:ve,targetNode:Me,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:fe.connectionMode,onError:w});return{zIndex:gpe({selected:C.selected,zIndex:C.zIndex,sourceNode:ve,targetNode:Me,elevateOnSelect:fe.elevateEdgesOnSelect}),...$e||HA}},[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),nn),D=S.useMemo(()=>C.markerStart?`url('#${tb(C.markerStart,y)}')`:void 0,[C.markerStart,y]),G=S.useMemo(()=>C.markerEnd?`url('#${tb(C.markerEnd,y)}')`:void 0,[C.markerEnd,y]);if(C.hidden||Z===null||B===null||W===null||L===null)return null;const K=fe=>{var ct;const{addSelectedEdges:ve,unselectNodesAndEdges:Me,multiSelectionActive:$e}=Y.getState();j&&(Y.setState({nodesSelectionActive:!1}),C.selected&&$e?(Me({nodes:[],edges:[C]}),(ct=R.current)==null||ct.blur()):ve([e])),i&&i(fe,C)},J=o?fe=>{o(fe,{...C})}:void 0,ee=s?fe=>{s(fe,{...C})}:void 0,re=a?fe=>{a(fe,{...C})}:void 0,ue=u?fe=>{u(fe,{...C})}:void 0,he=c?fe=>{c(fe,{...C})}:void 0,be=fe=>{var ve;if(!E&&n5.includes(fe.key)&&j){const{unselectNodesAndEdges:Me,addSelectedEdges:$e}=Y.getState();fe.key==="Escape"?((ve=R.current)==null||ve.blur(),Me({edges:[C]})):$e([e])}};return v.jsx("svg",{style:{zIndex:q},children:v.jsxs("g",{className:gn(["react-flow__edge",`react-flow__edge-${P}`,C.className,k,{selected:C.selected,animated:C.animated,inactive:!j&&!i,updating:$,selectable:j}]),onClick:K,onDoubleClick:J,onContextMenu:ee,onMouseEnter:re,onMouseMove:ue,onMouseLeave:he,onKeyDown:O?be:void 0,tabIndex:O?0:void 0,role:O?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":C.ariaLabel===null?void 0:C.ariaLabel||`Edge from ${C.source} to ${C.target}`,"aria-describedby":O?`${D5}-${y}`:void 0,ref:R,children:[!H&&v.jsx(A,{id:e,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,selectable:j,deletable:C.deletable??!0,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:Z,sourceY:B,targetX:W,targetY:L,sourcePosition:U,targetPosition:V,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:D,markerEnd:G,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),M&&v.jsx(Age,{edge:C,isReconnectable:M,reconnectRadius:f,onReconnect:h,onReconnectStart:p,onReconnectEnd:m,sourceX:Z,sourceY:B,targetX:W,targetY:L,sourcePosition:U,targetPosition:V,setUpdateHover:F,setReconnecting:I})]})})}const Rge=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function o3({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:o,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:f,reconnectRadius:h,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:y,disableKeyboardA11y:x}){const{edgesFocusable:k,edgesReconnectable:w,elementsSelectable:E,onError:C}=bt(Rge,nn),N=gge(t);return v.jsxs("div",{className:"react-flow__edges",children:[v.jsx(bge,{defaultColor:e,rfId:n}),N.map(P=>v.jsx(Pge,{id:P,edgesFocusable:k,edgesReconnectable:w,elementsSelectable:E,noPanClassName:i,onReconnect:o,onContextMenu:s,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,onClick:f,reconnectRadius:h,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:y,rfId:n,onError:C,edgeTypes:r,disableKeyboardA11y:x},P))]})}o3.displayName="EdgeRenderer";const Mge=S.memo(o3),Dge=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Oge({children:e}){const t=bt(Dge);return v.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Ige(e){const t=Ik(),n=S.useRef(!1);S.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const jge=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Lge(e){const t=bt(jge),n=qt();return S.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Fge(e){return e.connection.inProgress?{...e.connection,to:nf(e.connection.to,e.transform)}:{...e.connection}}function zge(e){return Fge}function $ge(e){const t=zge();return bt(t,nn)}const Bge=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Vge({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:o,height:s,isValid:a,inProgress:u}=bt(Bge,nn);return!(o&&i&&u)?null:v.jsx("svg",{style:e,width:o,height:s,className:"react-flow__connectionline react-flow__container",children:v.jsx("g",{className:gn(["react-flow__connection",i5(a)]),children:v.jsx(s3,{style:t,type:n,CustomComponent:r,isValid:a})})})}const s3=({style:e,type:t=ls.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:o,fromNode:s,fromHandle:a,fromPosition:u,to:c,toNode:f,toHandle:h,toPosition:p}=$ge();if(!i)return;if(n)return v.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:u,toPosition:p,connectionStatus:i5(r),toNode:f,toHandle:h});let m="";const y={sourceX:o.x,sourceY:o.y,sourcePosition:u,targetX:c.x,targetY:c.y,targetPosition:p};switch(t){case ls.Bezier:[m]=y5(y);break;case ls.SimpleBezier:[m]=q5(y);break;case ls.Step:[m]=eb({...y,borderRadius:0});break;case ls.SmoothStep:[m]=eb(y);break;default:[m]=x5(y)}return v.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};s3.displayName="ConnectionLine";const Wge={};function GA(e=Wge){S.useRef(e),qt(),S.useEffect(()=>{},[e])}function Uge(){qt(),S.useRef(!1),S.useEffect(()=>{},[])}function a3({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:o,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:f,onSelectionContextMenu:h,onSelectionStart:p,onSelectionEnd:m,connectionLineType:y,connectionLineStyle:x,connectionLineComponent:k,connectionLineContainerStyle:w,selectionKeyCode:E,selectionOnDrag:C,selectionMode:N,multiSelectionKeyCode:P,panActivationKeyCode:A,zoomActivationKeyCode:O,deleteKeyCode:M,onlyRenderVisibleElements:j,elementsSelectable:R,defaultViewport:$,translateExtent:F,minZoom:H,maxZoom:I,preventScrolling:Y,defaultMarkerColor:q,zoomOnScroll:Z,zoomOnPinch:B,panOnScroll:W,panOnScrollSpeed:L,panOnScrollMode:U,zoomOnDoubleClick:V,panOnDrag:D,onPaneClick:G,onPaneMouseEnter:K,onPaneMouseMove:J,onPaneMouseLeave:ee,onPaneScroll:re,onPaneContextMenu:ue,paneClickDistance:he,nodeClickDistance:be,onEdgeContextMenu:fe,onEdgeMouseEnter:ve,onEdgeMouseMove:Me,onEdgeMouseLeave:$e,reconnectRadius:ct,onReconnect:_t,onReconnectStart:Q,onReconnectEnd:oe,noDragClassName:ae,noWheelClassName:Ce,noPanClassName:ke,disableKeyboardA11y:ge,nodeExtent:Ae,rfId:Fe,viewport:ce,onViewportChange:pe}){return GA(e),GA(t),Uge(),Ige(n),Lge(ce),v.jsx(age,{onPaneClick:G,onPaneMouseEnter:K,onPaneMouseMove:J,onPaneMouseLeave:ee,onPaneContextMenu:ue,onPaneScroll:re,paneClickDistance:he,deleteKeyCode:M,selectionKeyCode:E,selectionOnDrag:C,selectionMode:N,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:P,panActivationKeyCode:A,zoomActivationKeyCode:O,elementsSelectable:R,zoomOnScroll:Z,zoomOnPinch:B,zoomOnDoubleClick:V,panOnScroll:W,panOnScrollSpeed:L,panOnScrollMode:U,panOnDrag:D,defaultViewport:$,translateExtent:F,minZoom:H,maxZoom:I,onSelectionContextMenu:h,preventScrolling:Y,noDragClassName:ae,noWheelClassName:Ce,noPanClassName:ke,disableKeyboardA11y:ge,onViewportChange:pe,isControlledViewport:!!ce,children:v.jsxs(Oge,{children:[v.jsx(Mge,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:s,onReconnect:_t,onReconnectStart:Q,onReconnectEnd:oe,onlyRenderVisibleElements:j,onEdgeContextMenu:fe,onEdgeMouseEnter:ve,onEdgeMouseMove:Me,onEdgeMouseLeave:$e,reconnectRadius:ct,defaultMarkerColor:q,noPanClassName:ke,disableKeyboardA11y:ge,rfId:Fe}),v.jsx(Vge,{style:x,type:y,component:k,containerStyle:w}),v.jsx("div",{className:"react-flow__edgelabel-renderer"}),v.jsx(mge,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:f,nodeClickDistance:be,onlyRenderVisibleElements:j,noPanClassName:ke,noDragClassName:ae,disableKeyboardA11y:ge,nodeExtent:Ae,rfId:Fe}),v.jsx("div",{className:"react-flow__viewport-portal"})]})})}a3.displayName="GraphView";const Hge=S.memo(a3),ZA=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:a,nodeExtent:u}={})=>{const c=new Map,f=new Map,h=new Map,p=new Map,m=r??t??[],y=n??e??[],x=a??[0,0],k=u??gd;b5(h,p,m),nb(y,c,f,{nodeOrigin:x,nodeExtent:k,elevateNodesOnSelect:!1});let w=[0,0,1];if(s&&i&&o){const E=tf(c,{filter:A=>!!((A.width||A.initialWidth)&&(A.height||A.initialHeight))}),{x:C,y:N,zoom:P}=Ak(E,i,o,.5,2,.1);w=[C,N,P]}return{rfId:"1",width:0,height:0,transform:w,nodes:y,nodeLookup:c,parentLookup:f,edges:m,edgeLookup:p,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:gd,nodeExtent:k,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Hl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...r5},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:ppe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},Yge=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:a,nodeExtent:u})=>dme((c,f)=>({...ZA({nodes:e,edges:t,width:i,height:o,fitView:s,nodeOrigin:a,nodeExtent:u,defaultNodes:n,defaultEdges:r}),setNodes:h=>{const{nodeLookup:p,parentLookup:m,nodeOrigin:y,elevateNodesOnSelect:x}=f();nb(h,p,m,{nodeOrigin:y,nodeExtent:u,elevateNodesOnSelect:x,checkEquality:!0}),c({nodes:h})},setEdges:h=>{const{connectionLookup:p,edgeLookup:m}=f();b5(p,m,h),c({edges:h})},setDefaultNodesAndEdges:(h,p)=>{if(h){const{setNodes:m}=f();m(h),c({hasDefaultNodes:!0})}if(p){const{setEdges:m}=f();m(p),c({hasDefaultEdges:!0})}},updateNodeInternals:(h,p={triggerFitView:!0})=>{const{triggerNodeChanges:m,nodeLookup:y,parentLookup:x,fitViewOnInit:k,fitViewDone:w,fitViewOnInitOptions:E,domNode:C,nodeOrigin:N,nodeExtent:P,debug:A,fitViewSync:O}=f(),{changes:M,updatedInternals:j}=Ppe(h,y,x,C,N,P);if(j){if(Npe(y,x,{nodeOrigin:N,nodeExtent:P}),p.triggerFitView){let R=w;!w&&k&&(R=O({...E,nodes:E==null?void 0:E.nodes})),c({fitViewDone:R})}else c({});(M==null?void 0:M.length)>0&&(A&&console.log("React Flow: trigger node changes",M),m==null||m(M))}},updateNodePositions:(h,p=!1)=>{const m=[],y=[];for(const[x,k]of h){const w=!!(k!=null&&k.expandParent&&(k!=null&&k.parentId)&&(k!=null&&k.position)),E={id:x,type:"position",position:w?{x:Math.max(0,k.position.x),y:Math.max(0,k.position.y)}:k.position,dragging:p};w&&m.push({id:x,parentId:k.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width,height:k.measured.height}}),y.push(E)}if(m.length>0){const{nodeLookup:x,parentLookup:k,nodeOrigin:w}=f(),E=Dk(m,x,k,w);y.push(...E)}f().triggerNodeChanges(y)},triggerNodeChanges:h=>{const{onNodesChange:p,setNodes:m,nodes:y,hasDefaultNodes:x,debug:k}=f();if(h!=null&&h.length){if(x){const w=j5(h,y);m(w)}k&&console.log("React Flow: trigger node changes",h),p==null||p(h)}},triggerEdgeChanges:h=>{const{onEdgesChange:p,setEdges:m,edges:y,hasDefaultEdges:x,debug:k}=f();if(h!=null&&h.length){if(x){const w=L5(h,y);m(w)}k&&console.log("React Flow: trigger edge changes",h),p==null||p(h)}},addSelectedNodes:h=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:y,triggerNodeChanges:x,triggerEdgeChanges:k}=f();if(p){const w=h.map(E=>Zs(E,!0));x(w);return}x(yl(y,new Set([...h]),!0)),k(yl(m))},addSelectedEdges:h=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:y,triggerNodeChanges:x,triggerEdgeChanges:k}=f();if(p){const w=h.map(E=>Zs(E,!0));k(w);return}k(yl(m,new Set([...h]))),x(yl(y,new Set,!0))},unselectNodesAndEdges:({nodes:h,edges:p}={})=>{const{edges:m,nodes:y,nodeLookup:x,triggerNodeChanges:k,triggerEdgeChanges:w}=f(),E=h||y,C=p||m,N=E.map(A=>{const O=x.get(A.id);return O&&(O.selected=!1),Zs(A.id,!1)}),P=C.map(A=>Zs(A.id,!1));k(N),w(P)},setMinZoom:h=>{const{panZoom:p,maxZoom:m}=f();p==null||p.setScaleExtent([h,m]),c({minZoom:h})},setMaxZoom:h=>{const{panZoom:p,minZoom:m}=f();p==null||p.setScaleExtent([m,h]),c({maxZoom:h})},setTranslateExtent:h=>{var p;(p=f().panZoom)==null||p.setTranslateExtent(h),c({translateExtent:h})},setPaneClickDistance:h=>{var p;(p=f().panZoom)==null||p.setClickDistance(h)},resetSelectedElements:()=>{const{edges:h,nodes:p,triggerNodeChanges:m,triggerEdgeChanges:y}=f(),x=p.reduce((w,E)=>E.selected?[...w,Zs(E.id,!1)]:w,[]),k=h.reduce((w,E)=>E.selected?[...w,Zs(E.id,!1)]:w,[]);m(x),y(k)},setNodeExtent:h=>{const{nodes:p,nodeLookup:m,parentLookup:y,nodeOrigin:x,elevateNodesOnSelect:k,nodeExtent:w}=f();h[0][0]===w[0][0]&&h[0][1]===w[0][1]&&h[1][0]===w[1][0]&&h[1][1]===w[1][1]||(nb(p,m,y,{nodeOrigin:x,nodeExtent:h,elevateNodesOnSelect:k,checkEquality:!1}),c({nodeExtent:h}))},panBy:h=>{const{transform:p,width:m,height:y,panZoom:x,translateExtent:k}=f();return Rpe({delta:h,panZoom:x,transform:p,translateExtent:k,width:m,height:y})},fitView:h=>{const{panZoom:p,width:m,height:y,minZoom:x,maxZoom:k,nodeLookup:w}=f();if(!p)return Promise.resolve(!1);const E=Kw(w,h);return Xw({nodes:E,width:m,height:y,panZoom:p,minZoom:x,maxZoom:k},h)},fitViewSync:h=>{const{panZoom:p,width:m,height:y,minZoom:x,maxZoom:k,nodeLookup:w}=f();if(!p)return!1;const E=Kw(w,h);return Xw({nodes:E,width:m,height:y,panZoom:p,minZoom:x,maxZoom:k},h),E.size>0},cancelConnection:()=>{c({connection:{...r5}})},updateConnection:h=>{c({connection:h})},reset:()=>c({...ZA()})}),Object.is);function qge({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:o,fitView:s,nodeOrigin:a,nodeExtent:u,children:c}){const[f]=S.useState(()=>Yge({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:s,nodeOrigin:a,nodeExtent:u}));return v.jsx(fme,{value:f,children:v.jsx(Ime,{children:c})})}function Gge({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:o,height:s,fitView:a,nodeOrigin:u,nodeExtent:c}){return S.useContext(ig)?v.jsx(v.Fragment,{children:e}):v.jsx(qge,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:o,initialHeight:s,fitView:a,nodeOrigin:u,nodeExtent:c,children:e})}const Zge={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Kge({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o,edgeTypes:s,onNodeClick:a,onEdgeClick:u,onInit:c,onMove:f,onMoveStart:h,onMoveEnd:p,onConnect:m,onConnectStart:y,onConnectEnd:x,onClickConnectStart:k,onClickConnectEnd:w,onNodeMouseEnter:E,onNodeMouseMove:C,onNodeMouseLeave:N,onNodeContextMenu:P,onNodeDoubleClick:A,onNodeDragStart:O,onNodeDrag:M,onNodeDragStop:j,onNodesDelete:R,onEdgesDelete:$,onDelete:F,onSelectionChange:H,onSelectionDragStart:I,onSelectionDrag:Y,onSelectionDragStop:q,onSelectionContextMenu:Z,onSelectionStart:B,onSelectionEnd:W,onBeforeDelete:L,connectionMode:U,connectionLineType:V=ls.Bezier,connectionLineStyle:D,connectionLineComponent:G,connectionLineContainerStyle:K,deleteKeyCode:J="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:re=!1,selectionMode:ue=yd.Full,panActivationKeyCode:he="Space",multiSelectionKeyCode:be=Xp()?"Meta":"Control",zoomActivationKeyCode:fe=Xp()?"Meta":"Control",snapToGrid:ve,snapGrid:Me,onlyRenderVisibleElements:$e=!1,selectNodesOnDrag:ct,nodesDraggable:_t,nodesConnectable:Q,nodesFocusable:oe,nodeOrigin:ae=O5,edgesFocusable:Ce,edgesReconnectable:ke,elementsSelectable:ge=!0,defaultViewport:Ae=Cme,minZoom:Fe=.5,maxZoom:ce=2,translateExtent:pe=gd,preventScrolling:Ie=!0,nodeExtent:Ke,defaultMarkerColor:tt="#b1b1b7",zoomOnScroll:At=!0,zoomOnPinch:He=!0,panOnScroll:it=!1,panOnScrollSpeed:at=.5,panOnScrollMode:Wt=sa.Free,zoomOnDoubleClick:yt=!0,panOnDrag:yn=!0,onPaneClick:gt,onPaneMouseEnter:jt,onPaneMouseMove:ft,onPaneMouseLeave:Ye,onPaneScroll:dt,onPaneContextMenu:Ct,paneClickDistance:rn=0,nodeClickDistance:vn=0,children:Yi,onReconnect:Sa,onReconnectStart:du,onReconnectEnd:rf,onEdgeContextMenu:As,onEdgeDoubleClick:fu,onEdgeMouseEnter:Ps,onEdgeMouseMove:ag,onEdgeMouseLeave:Rs,reconnectRadius:Ea=10,onNodesChange:Ca,onEdgesChange:hu,noDragClassName:lg="nodrag",noWheelClassName:ug="nowheel",noPanClassName:of="nopan",fitView:vi,fitViewOptions:sf,connectOnClick:af,attributionPosition:cg,proOptions:lf,defaultEdgeOptions:uf,elevateNodesOnSelect:cf,elevateEdgesOnSelect:df,disableKeyboardA11y:ff=!1,autoPanOnConnect:dg,autoPanOnNodeDrag:Gt,autoPanSpeed:fg,connectionRadius:pu,isValidConnection:hf,onError:_a,style:hg,id:mu,nodeDragThreshold:Na,viewport:Mr,onViewportChange:pg,width:pr,height:mg,colorMode:gg="light",debug:yg,...Ta},Aa){const qi=mu||"1",Pa=Ame(gg);return v.jsx("div",{"data-testid":"rf__wrapper",...Ta,style:{...hg,...Zge},ref:Aa,className:gn(["react-flow",i,Pa]),id:mu,children:v.jsxs(Gge,{nodes:e,edges:t,width:pr,height:mg,fitView:vi,nodeOrigin:ae,nodeExtent:Ke,children:[v.jsx(Hge,{onInit:c,onNodeClick:a,onEdgeClick:u,onNodeMouseEnter:E,onNodeMouseMove:C,onNodeMouseLeave:N,onNodeContextMenu:P,onNodeDoubleClick:A,nodeTypes:o,edgeTypes:s,connectionLineType:V,connectionLineStyle:D,connectionLineComponent:G,connectionLineContainerStyle:K,selectionKeyCode:ee,selectionOnDrag:re,selectionMode:ue,deleteKeyCode:J,multiSelectionKeyCode:be,panActivationKeyCode:he,zoomActivationKeyCode:fe,onlyRenderVisibleElements:$e,defaultViewport:Ae,translateExtent:pe,minZoom:Fe,maxZoom:ce,preventScrolling:Ie,zoomOnScroll:At,zoomOnPinch:He,zoomOnDoubleClick:yt,panOnScroll:it,panOnScrollSpeed:at,panOnScrollMode:Wt,panOnDrag:yn,onPaneClick:gt,onPaneMouseEnter:jt,onPaneMouseMove:ft,onPaneMouseLeave:Ye,onPaneScroll:dt,onPaneContextMenu:Ct,paneClickDistance:rn,nodeClickDistance:vn,onSelectionContextMenu:Z,onSelectionStart:B,onSelectionEnd:W,onReconnect:Sa,onReconnectStart:du,onReconnectEnd:rf,onEdgeContextMenu:As,onEdgeDoubleClick:fu,onEdgeMouseEnter:Ps,onEdgeMouseMove:ag,onEdgeMouseLeave:Rs,reconnectRadius:Ea,defaultMarkerColor:tt,noDragClassName:lg,noWheelClassName:ug,noPanClassName:of,rfId:qi,disableKeyboardA11y:ff,nodeExtent:Ke,viewport:Mr,onViewportChange:pg}),v.jsx(Tme,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:y,onConnectEnd:x,onClickConnectStart:k,onClickConnectEnd:w,nodesDraggable:_t,nodesConnectable:Q,nodesFocusable:oe,edgesFocusable:Ce,edgesReconnectable:ke,elementsSelectable:ge,elevateNodesOnSelect:cf,elevateEdgesOnSelect:df,minZoom:Fe,maxZoom:ce,nodeExtent:Ke,onNodesChange:Ca,onEdgesChange:hu,snapToGrid:ve,snapGrid:Me,connectionMode:U,translateExtent:pe,connectOnClick:af,defaultEdgeOptions:uf,fitView:vi,fitViewOptions:sf,onNodesDelete:R,onEdgesDelete:$,onDelete:F,onNodeDragStart:O,onNodeDrag:M,onNodeDragStop:j,onSelectionDrag:Y,onSelectionDragStart:I,onSelectionDragStop:q,onMove:f,onMoveStart:h,onMoveEnd:p,noPanClassName:of,nodeOrigin:ae,rfId:qi,autoPanOnConnect:dg,autoPanOnNodeDrag:Gt,autoPanSpeed:fg,onError:_a,connectionRadius:pu,isValidConnection:hf,selectNodesOnDrag:ct,nodeDragThreshold:Na,onBeforeDelete:L,paneClickDistance:rn,debug:yg}),v.jsx(Eme,{onSelectionChange:H}),Yi,v.jsx(xme,{proOptions:lf,position:cg}),v.jsx(yme,{rfId:qi,disableKeyboardA11y:ff})]})})}var Xge=F5(Kge);function Qge(e){const[t,n]=S.useState(e),r=S.useCallback(i=>n(o=>j5(i,o)),[]);return[t,n,r]}function Jge(e){const[t,n]=S.useState(e),r=S.useCallback(i=>n(o=>L5(i,o)),[]);return[t,n,r]}function eye({dimensions:e,lineWidth:t,variant:n,className:r}){return v.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:gn(["react-flow__background-pattern",n,r])})}function tye({radius:e,className:t}){return v.jsx("circle",{cx:e,cy:e,r:e,className:gn(["react-flow__background-pattern","dots",t])})}var vo;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(vo||(vo={}));const nye={[vo.Dots]:1,[vo.Lines]:1,[vo.Cross]:6},rye=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function l3({id:e,variant:t=vo.Dots,gap:n=20,size:r,lineWidth:i=1,offset:o=0,color:s,bgColor:a,style:u,className:c,patternClassName:f}){const h=S.useRef(null),{transform:p,patternId:m}=bt(rye,nn),y=r||nye[t],x=t===vo.Dots,k=t===vo.Cross,w=Array.isArray(n)?n:[n,n],E=[w[0]*p[2]||1,w[1]*p[2]||1],C=y*p[2],N=Array.isArray(o)?o:[o,o],P=k?[C,C]:E,A=[N[0]*p[2]||1+P[0]/2,N[1]*p[2]||1+P[1]/2],O=`${m}${e||""}`;return v.jsxs("svg",{className:gn(["react-flow__background",c]),style:{...u,...og,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:h,"data-testid":"rf__background",children:[v.jsx("pattern",{id:O,x:p[0]%E[0],y:p[1]%E[1],width:E[0],height:E[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:x?v.jsx(tye,{radius:C/2,className:f}):v.jsx(eye,{dimensions:P,lineWidth:i,variant:t,className:f})}),v.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${O})`})]})}l3.displayName="Background";const iye=S.memo(l3);function oye(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:v.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function sye(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:v.jsx("path",{d:"M0 0h32v4.2H0z"})})}function aye(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:v.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function lye(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function uye(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Bh({children:e,className:t,...n}){return v.jsx("button",{type:"button",className:gn(["react-flow__controls-button",t]),...n,children:e})}const cye=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function u3({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:s,onFitView:a,onInteractiveChange:u,className:c,children:f,position:h="bottom-left",orientation:p="vertical","aria-label":m="React Flow controls"}){const y=qt(),{isInteractive:x,minZoomReached:k,maxZoomReached:w}=bt(cye,nn),{zoomIn:E,zoomOut:C,fitView:N}=Ik(),P=()=>{E(),o==null||o()},A=()=>{C(),s==null||s()},O=()=>{N(i),a==null||a()},M=()=>{y.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),u==null||u(!x)},j=p==="horizontal"?"horizontal":"vertical";return v.jsxs(Ok,{className:gn(["react-flow__controls",j,c]),position:h,style:e,"data-testid":"rf__controls","aria-label":m,children:[t&&v.jsxs(v.Fragment,{children:[v.jsx(Bh,{onClick:P,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:w,children:v.jsx(oye,{})}),v.jsx(Bh,{onClick:A,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:k,children:v.jsx(sye,{})})]}),n&&v.jsx(Bh,{className:"react-flow__controls-fitview",onClick:O,title:"fit view","aria-label":"fit view",children:v.jsx(aye,{})}),r&&v.jsx(Bh,{className:"react-flow__controls-interactive",onClick:M,title:"toggle interactivity","aria-label":"toggle interactivity",children:x?v.jsx(uye,{}):v.jsx(lye,{})}),f]})}u3.displayName="Controls";const dye=S.memo(u3);function fye({id:e,x:t,y:n,width:r,height:i,style:o,color:s,strokeColor:a,strokeWidth:u,className:c,borderRadius:f,shapeRendering:h,selected:p,onClick:m}){const{background:y,backgroundColor:x}=o||{},k=s||y||x;return v.jsx("rect",{className:gn(["react-flow__minimap-node",{selected:p},c]),x:t,y:n,rx:f,ry:f,width:r,height:i,style:{fill:k,stroke:a,strokeWidth:u},shapeRendering:h,onClick:m?w=>m(w,e):void 0})}const hye=S.memo(fye),pye=e=>e.nodes.map(t=>t.id),Mx=e=>e instanceof Function?e:()=>e;function mye({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:o=hye,onClick:s}){const a=bt(pye,nn),u=Mx(t),c=Mx(e),f=Mx(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return v.jsx(v.Fragment,{children:a.map(p=>v.jsx(yye,{id:p,nodeColorFunc:u,nodeStrokeColorFunc:c,nodeClassNameFunc:f,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:o,onClick:s,shapeRendering:h},p))})}function gye({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:o,shapeRendering:s,NodeComponent:a,onClick:u}){const{node:c,x:f,y:h,width:p,height:m}=bt(y=>{const x=y.nodeLookup.get(e),{x:k,y:w}=x.internals.positionAbsolute,{width:E,height:C}=Ro(x);return{node:x,x:k,y:w,width:E,height:C}},nn);return!c||c.hidden||!f5(c)?null:v.jsx(a,{x:f,y:h,width:p,height:m,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:i,strokeColor:n(c),strokeWidth:o,shapeRendering:s,onClick:u,id:c.id})}const yye=S.memo(gye);var vye=S.memo(mye);const xye=200,wye=150,bye=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?c5(tf(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},kye="react-flow__minimap-desc";function c3({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:u,maskColor:c,maskStrokeColor:f,maskStrokeWidth:h,position:p="bottom-right",onClick:m,onNodeClick:y,pannable:x=!1,zoomable:k=!1,ariaLabel:w="React Flow mini map",inversePan:E,zoomStep:C=10,offsetScale:N=5}){const P=qt(),A=S.useRef(null),{boundingRect:O,viewBB:M,rfId:j,panZoom:R,translateExtent:$,flowWidth:F,flowHeight:H}=bt(bye,nn),I=(e==null?void 0:e.width)??xye,Y=(e==null?void 0:e.height)??wye,q=O.width/I,Z=O.height/Y,B=Math.max(q,Z),W=B*I,L=B*Y,U=N*B,V=O.x-(W-O.width)/2-U,D=O.y-(L-O.height)/2-U,G=W+U*2,K=L+U*2,J=`${kye}-${j}`,ee=S.useRef(0),re=S.useRef();ee.current=B,S.useEffect(()=>{if(A.current&&R)return re.current=zpe({domNode:A.current,panZoom:R,getTransform:()=>P.getState().transform,getViewScale:()=>ee.current}),()=>{var be;(be=re.current)==null||be.destroy()}},[R]),S.useEffect(()=>{var be;(be=re.current)==null||be.update({translateExtent:$,width:F,height:H,inversePan:E,pannable:x,zoomStep:C,zoomable:k})},[x,k,E,C,$,F,H]);const ue=m?be=>{var Me;const[fe,ve]=((Me=re.current)==null?void 0:Me.pointer(be))||[0,0];m(be,{x:fe,y:ve})}:void 0,he=y?S.useCallback((be,fe)=>{const ve=P.getState().nodeLookup.get(fe);y(be,ve)},[]):void 0;return v.jsx(Ok,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*B:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="string"?s:void 0},className:gn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:v.jsxs("svg",{width:I,height:Y,viewBox:`${V} ${D} ${G} ${K}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":J,ref:A,onClick:ue,children:[w&&v.jsx("title",{id:J,children:w}),v.jsx(vye,{onClick:he,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:i,nodeStrokeWidth:s,nodeComponent:a}),v.jsx("path",{className:"react-flow__minimap-mask",d:`M${V-U},${D-U}h${G+U*2}v${K+U*2}h${-G-U*2}z
389
+ M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}c3.displayName="MiniMap";const Sye=S.memo(c3);function Eye({nodeId:e,position:t,variant:n=Oc.Handle,className:r,style:i={},children:o,color:s,minWidth:a=10,minHeight:u=10,maxWidth:c=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:h=!1,shouldResize:p,onResizeStart:m,onResize:y,onResizeEnd:x}){const k=V5(),w=typeof e=="string"?e:k,E=qt(),C=S.useRef(null),N=n===Oc.Line?"right":"bottom-right",P=t??N,A=S.useRef(null);S.useEffect(()=>{if(!(!C.current||!w))return A.current||(A.current=eme({domNode:C.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:R,transform:$,snapGrid:F,snapToGrid:H,nodeOrigin:I,domNode:Y}=E.getState();return{nodeLookup:R,transform:$,snapGrid:F,snapToGrid:H,nodeOrigin:I,paneDomNode:Y}},onChange:(R,$)=>{const{triggerNodeChanges:F,nodeLookup:H,parentLookup:I,nodeOrigin:Y}=E.getState(),q=[],Z={x:R.x,y:R.y},B=H.get(w);if(B&&B.expandParent&&B.parentId){const W=B.origin??Y,L=R.width??B.measured.width,U=R.height??B.measured.height,V={id:B.id,parentId:B.parentId,rect:{width:L,height:U,...h5({x:R.x??B.position.x,y:R.y??B.position.y},{width:L,height:U},B.parentId,H,W)}},D=Dk([V],H,I,Y);q.push(...D),Z.x=R.x?Math.max(W[0]*L,R.x):void 0,Z.y=R.y?Math.max(W[1]*U,R.y):void 0}if(Z.x!==void 0&&Z.y!==void 0){const W={id:w,type:"position",position:{...Z}};q.push(W)}if(R.width!==void 0&&R.height!==void 0){const W={id:w,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:R.width,height:R.height}};q.push(W)}for(const W of $){const L={...W,type:"position"};q.push(L)}F(q)},onEnd:()=>{const R={id:w,type:"dimensions",resizing:!1};E.getState().triggerNodeChanges([R])}})),A.current.update({controlPosition:P,boundaries:{minWidth:a,minHeight:u,maxWidth:c,maxHeight:f},keepAspectRatio:h,onResizeStart:m,onResize:y,onResizeEnd:x,shouldResize:p}),()=>{var R;(R=A.current)==null||R.destroy()}},[P,a,u,c,f,h,m,y,x,p]);const O=P.split("-"),M=n===Oc.Line?"borderColor":"backgroundColor",j=s?{...i,[M]:s}:i;return v.jsx("div",{className:gn(["react-flow__resize-control","nodrag",...O,n,r]),ref:C,style:j,children:o})}S.memo(Eye);var Dx,KA;function Lk(){if(KA)return Dx;KA=1;var e="\0",t="\0",n="";class r{constructor(f){un(this,"_isDirected",!0);un(this,"_isMultigraph",!1);un(this,"_isCompound",!1);un(this,"_label");un(this,"_defaultNodeLabelFn",()=>{});un(this,"_defaultEdgeLabelFn",()=>{});un(this,"_nodes",{});un(this,"_in",{});un(this,"_preds",{});un(this,"_out",{});un(this,"_sucs",{});un(this,"_edgeObjs",{});un(this,"_edgeLabels",{});un(this,"_nodeCount",0);un(this,"_edgeCount",0);un(this,"_parent");un(this,"_children");f&&(this._isDirected=Object.hasOwn(f,"directed")?f.directed:!0,this._isMultigraph=Object.hasOwn(f,"multigraph")?f.multigraph:!1,this._isCompound=Object.hasOwn(f,"compound")?f.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[t]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(f){return this._label=f,this}graph(){return this._label}setDefaultNodeLabel(f){return this._defaultNodeLabelFn=f,typeof f!="function"&&(this._defaultNodeLabelFn=()=>f),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var f=this;return this.nodes().filter(h=>Object.keys(f._in[h]).length===0)}sinks(){var f=this;return this.nodes().filter(h=>Object.keys(f._out[h]).length===0)}setNodes(f,h){var p=arguments,m=this;return f.forEach(function(y){p.length>1?m.setNode(y,h):m.setNode(y)}),this}setNode(f,h){return Object.hasOwn(this._nodes,f)?(arguments.length>1&&(this._nodes[f]=h),this):(this._nodes[f]=arguments.length>1?h:this._defaultNodeLabelFn(f),this._isCompound&&(this._parent[f]=t,this._children[f]={},this._children[t][f]=!0),this._in[f]={},this._preds[f]={},this._out[f]={},this._sucs[f]={},++this._nodeCount,this)}node(f){return this._nodes[f]}hasNode(f){return Object.hasOwn(this._nodes,f)}removeNode(f){var h=this;if(Object.hasOwn(this._nodes,f)){var p=m=>h.removeEdge(h._edgeObjs[m]);delete this._nodes[f],this._isCompound&&(this._removeFromParentsChildList(f),delete this._parent[f],this.children(f).forEach(function(m){h.setParent(m)}),delete this._children[f]),Object.keys(this._in[f]).forEach(p),delete this._in[f],delete this._preds[f],Object.keys(this._out[f]).forEach(p),delete this._out[f],delete this._sucs[f],--this._nodeCount}return this}setParent(f,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(h===void 0)h=t;else{h+="";for(var p=h;p!==void 0;p=this.parent(p))if(p===f)throw new Error("Setting "+h+" as parent of "+f+" would create a cycle");this.setNode(h)}return this.setNode(f),this._removeFromParentsChildList(f),this._parent[f]=h,this._children[h][f]=!0,this}_removeFromParentsChildList(f){delete this._children[this._parent[f]][f]}parent(f){if(this._isCompound){var h=this._parent[f];if(h!==t)return h}}children(f=t){if(this._isCompound){var h=this._children[f];if(h)return Object.keys(h)}else{if(f===t)return this.nodes();if(this.hasNode(f))return[]}}predecessors(f){var h=this._preds[f];if(h)return Object.keys(h)}successors(f){var h=this._sucs[f];if(h)return Object.keys(h)}neighbors(f){var h=this.predecessors(f);if(h){const m=new Set(h);for(var p of this.successors(f))m.add(p);return Array.from(m.values())}}isLeaf(f){var h;return this.isDirected()?h=this.successors(f):h=this.neighbors(f),h.length===0}filterNodes(f){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var p=this;Object.entries(this._nodes).forEach(function([x,k]){f(x)&&h.setNode(x,k)}),Object.values(this._edgeObjs).forEach(function(x){h.hasNode(x.v)&&h.hasNode(x.w)&&h.setEdge(x,p.edge(x))});var m={};function y(x){var k=p.parent(x);return k===void 0||h.hasNode(k)?(m[x]=k,k):k in m?m[k]:y(k)}return this._isCompound&&h.nodes().forEach(x=>h.setParent(x,y(x))),h}setDefaultEdgeLabel(f){return this._defaultEdgeLabelFn=f,typeof f!="function"&&(this._defaultEdgeLabelFn=()=>f),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(f,h){var p=this,m=arguments;return f.reduce(function(y,x){return m.length>1?p.setEdge(y,x,h):p.setEdge(y,x),x}),this}setEdge(){var f,h,p,m,y=!1,x=arguments[0];typeof x=="object"&&x!==null&&"v"in x?(f=x.v,h=x.w,p=x.name,arguments.length===2&&(m=arguments[1],y=!0)):(f=x,h=arguments[1],p=arguments[3],arguments.length>2&&(m=arguments[2],y=!0)),f=""+f,h=""+h,p!==void 0&&(p=""+p);var k=s(this._isDirected,f,h,p);if(Object.hasOwn(this._edgeLabels,k))return y&&(this._edgeLabels[k]=m),this;if(p!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(f),this.setNode(h),this._edgeLabels[k]=y?m:this._defaultEdgeLabelFn(f,h,p);var w=a(this._isDirected,f,h,p);return f=w.v,h=w.w,Object.freeze(w),this._edgeObjs[k]=w,i(this._preds[h],f),i(this._sucs[f],h),this._in[h][k]=w,this._out[f][k]=w,this._edgeCount++,this}edge(f,h,p){var m=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,f,h,p);return this._edgeLabels[m]}edgeAsObj(){const f=this.edge(...arguments);return typeof f!="object"?{label:f}:f}hasEdge(f,h,p){var m=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,f,h,p);return Object.hasOwn(this._edgeLabels,m)}removeEdge(f,h,p){var m=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,f,h,p),y=this._edgeObjs[m];return y&&(f=y.v,h=y.w,delete this._edgeLabels[m],delete this._edgeObjs[m],o(this._preds[h],f),o(this._sucs[f],h),delete this._in[h][m],delete this._out[f][m],this._edgeCount--),this}inEdges(f,h){var p=this._in[f];if(p){var m=Object.values(p);return h?m.filter(y=>y.v===h):m}}outEdges(f,h){var p=this._out[f];if(p){var m=Object.values(p);return h?m.filter(y=>y.w===h):m}}nodeEdges(f,h){var p=this.inEdges(f,h);if(p)return p.concat(this.outEdges(f,h))}}function i(c,f){c[f]?c[f]++:c[f]=1}function o(c,f){--c[f]||delete c[f]}function s(c,f,h,p){var m=""+f,y=""+h;if(!c&&m>y){var x=m;m=y,y=x}return m+n+y+n+(p===void 0?e:p)}function a(c,f,h,p){var m=""+f,y=""+h;if(!c&&m>y){var x=m;m=y,y=x}var k={v:m,w:y};return p&&(k.name=p),k}function u(c,f){return s(c,f.v,f.w,f.name)}return Dx=r,Dx}var Ox,XA;function Cye(){return XA||(XA=1,Ox="2.2.4"),Ox}var Ix,QA;function _ye(){return QA||(QA=1,Ix={Graph:Lk(),version:Cye()}),Ix}var jx,JA;function Nye(){if(JA)return jx;JA=1;var e=Lk();jx={write:t,read:i};function t(o){var s={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:n(o),edges:r(o)};return o.graph()!==void 0&&(s.value=structuredClone(o.graph())),s}function n(o){return o.nodes().map(function(s){var a=o.node(s),u=o.parent(s),c={v:s};return a!==void 0&&(c.value=a),u!==void 0&&(c.parent=u),c})}function r(o){return o.edges().map(function(s){var a=o.edge(s),u={v:s.v,w:s.w};return s.name!==void 0&&(u.name=s.name),a!==void 0&&(u.value=a),u})}function i(o){var s=new e(o.options).setGraph(o.value);return o.nodes.forEach(function(a){s.setNode(a.v,a.value),a.parent&&s.setParent(a.v,a.parent)}),o.edges.forEach(function(a){s.setEdge({v:a.v,w:a.w,name:a.name},a.value)}),s}return jx}var Lx,eP;function Tye(){if(eP)return Lx;eP=1,Lx=e;function e(t){var n={},r=[],i;function o(s){Object.hasOwn(n,s)||(n[s]=!0,i.push(s),t.successors(s).forEach(o),t.predecessors(s).forEach(o))}return t.nodes().forEach(function(s){i=[],o(s),i.length&&r.push(i)}),r}return Lx}var Fx,tP;function d3(){if(tP)return Fx;tP=1;class e{constructor(){un(this,"_arr",[]);un(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,r){var i=this._keyIndices;if(n=String(n),!Object.hasOwn(i,n)){var o=this._arr,s=o.length;return i[n]=s,o.push({key:n,priority:r}),this._decrease(s),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,r){var i=this._keyIndices[n];if(r>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[i].priority+" New: "+r);this._arr[i].priority=r,this._decrease(i)}_heapify(n){var r=this._arr,i=2*n,o=i+1,s=n;i<r.length&&(s=r[i].priority<r[s].priority?i:s,o<r.length&&(s=r[o].priority<r[s].priority?o:s),s!==n&&(this._swap(n,s),this._heapify(s)))}_decrease(n){for(var r=this._arr,i=r[n].priority,o;n!==0&&(o=n>>1,!(r[o].priority<i));)this._swap(n,o),n=o}_swap(n,r){var i=this._arr,o=this._keyIndices,s=i[n],a=i[r];i[n]=a,i[r]=s,o[a.key]=n,o[s.key]=r}}return Fx=e,Fx}var zx,nP;function f3(){if(nP)return zx;nP=1;var e=d3();zx=n;var t=()=>1;function n(i,o,s,a){return r(i,String(o),s||t,a||function(u){return i.outEdges(u)})}function r(i,o,s,a){var u={},c=new e,f,h,p=function(m){var y=m.v!==f?m.v:m.w,x=u[y],k=s(m),w=h.distance+k;if(k<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+m+" Weight: "+k);w<x.distance&&(x.distance=w,x.predecessor=f,c.decrease(y,w))};for(i.nodes().forEach(function(m){var y=m===o?0:Number.POSITIVE_INFINITY;u[m]={distance:y},c.add(m,y)});c.size()>0&&(f=c.removeMin(),h=u[f],h.distance!==Number.POSITIVE_INFINITY);)a(f).forEach(p);return u}return zx}var $x,rP;function Aye(){if(rP)return $x;rP=1;var e=f3();$x=t;function t(n,r,i){return n.nodes().reduce(function(o,s){return o[s]=e(n,s,r,i),o},{})}return $x}var Bx,iP;function h3(){if(iP)return Bx;iP=1,Bx=e;function e(t){var n=0,r=[],i={},o=[];function s(a){var u=i[a]={onStack:!0,lowlink:n,index:n++};if(r.push(a),t.successors(a).forEach(function(h){Object.hasOwn(i,h)?i[h].onStack&&(u.lowlink=Math.min(u.lowlink,i[h].index)):(s(h),u.lowlink=Math.min(u.lowlink,i[h].lowlink))}),u.lowlink===u.index){var c=[],f;do f=r.pop(),i[f].onStack=!1,c.push(f);while(a!==f);o.push(c)}}return t.nodes().forEach(function(a){Object.hasOwn(i,a)||s(a)}),o}return Bx}var Vx,oP;function Pye(){if(oP)return Vx;oP=1;var e=h3();Vx=t;function t(n){return e(n).filter(function(r){return r.length>1||r.length===1&&n.hasEdge(r[0],r[0])})}return Vx}var Wx,sP;function Rye(){if(sP)return Wx;sP=1,Wx=t;var e=()=>1;function t(r,i,o){return n(r,i||e,o||function(s){return r.outEdges(s)})}function n(r,i,o){var s={},a=r.nodes();return a.forEach(function(u){s[u]={},s[u][u]={distance:0},a.forEach(function(c){u!==c&&(s[u][c]={distance:Number.POSITIVE_INFINITY})}),o(u).forEach(function(c){var f=c.v===u?c.w:c.v,h=i(c);s[u][f]={distance:h,predecessor:u}})}),a.forEach(function(u){var c=s[u];a.forEach(function(f){var h=s[f];a.forEach(function(p){var m=h[u],y=c[p],x=h[p],k=m.distance+y.distance;k<x.distance&&(x.distance=k,x.predecessor=y.predecessor)})})}),s}return Wx}var Ux,aP;function p3(){if(aP)return Ux;aP=1;function e(n){var r={},i={},o=[];function s(a){if(Object.hasOwn(i,a))throw new t;Object.hasOwn(r,a)||(i[a]=!0,r[a]=!0,n.predecessors(a).forEach(s),delete i[a],o.push(a))}if(n.sinks().forEach(s),Object.keys(r).length!==n.nodeCount())throw new t;return o}class t extends Error{constructor(){super(...arguments)}}return Ux=e,e.CycleException=t,Ux}var Hx,lP;function Mye(){if(lP)return Hx;lP=1;var e=p3();Hx=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return Hx}var Yx,uP;function m3(){if(uP)return Yx;uP=1,Yx=e;function e(i,o,s){Array.isArray(o)||(o=[o]);var a=i.isDirected()?h=>i.successors(h):h=>i.neighbors(h),u=s==="post"?t:n,c=[],f={};return o.forEach(h=>{if(!i.hasNode(h))throw new Error("Graph does not have node: "+h);u(h,a,f,c)}),c}function t(i,o,s,a){for(var u=[[i,!1]];u.length>0;){var c=u.pop();c[1]?a.push(c[0]):Object.hasOwn(s,c[0])||(s[c[0]]=!0,u.push([c[0],!0]),r(o(c[0]),f=>u.push([f,!1])))}}function n(i,o,s,a){for(var u=[i];u.length>0;){var c=u.pop();Object.hasOwn(s,c)||(s[c]=!0,a.push(c),r(o(c),f=>u.push(f)))}}function r(i,o){for(var s=i.length;s--;)o(i[s],s,i);return i}return Yx}var qx,cP;function Dye(){if(cP)return qx;cP=1;var e=m3();qx=t;function t(n,r){return e(n,r,"post")}return qx}var Gx,dP;function Oye(){if(dP)return Gx;dP=1;var e=m3();Gx=t;function t(n,r){return e(n,r,"pre")}return Gx}var Zx,fP;function Iye(){if(fP)return Zx;fP=1;var e=Lk(),t=d3();Zx=n;function n(r,i){var o=new e,s={},a=new t,u;function c(h){var p=h.v===u?h.w:h.v,m=a.priority(p);if(m!==void 0){var y=i(h);y<m&&(s[p]=u,a.decrease(p,y))}}if(r.nodeCount()===0)return o;r.nodes().forEach(function(h){a.add(h,Number.POSITIVE_INFINITY),o.setNode(h)}),a.decrease(r.nodes()[0],0);for(var f=!1;a.size()>0;){if(u=a.removeMin(),Object.hasOwn(s,u))o.setEdge(u,s[u]);else{if(f)throw new Error("Input graph is not connected: "+r);f=!0}r.nodeEdges(u).forEach(c)}return o}return Zx}var Kx,hP;function jye(){return hP||(hP=1,Kx={components:Tye(),dijkstra:f3(),dijkstraAll:Aye(),findCycles:Pye(),floydWarshall:Rye(),isAcyclic:Mye(),postorder:Dye(),preorder:Oye(),prim:Iye(),tarjan:h3(),topsort:p3()}),Kx}var Xx,pP;function pi(){if(pP)return Xx;pP=1;var e=_ye();return Xx={Graph:e.Graph,json:Nye(),alg:jye(),version:e.version},Xx}var Qx,mP;function Lye(){if(mP)return Qx;mP=1;class e{constructor(){let i={};i._next=i._prev=i,this._sentinel=i}dequeue(){let i=this._sentinel,o=i._prev;if(o!==i)return t(o),o}enqueue(i){let o=this._sentinel;i._prev&&i._next&&t(i),i._next=o._next,o._next._prev=i,o._next=i,i._prev=o}toString(){let i=[],o=this._sentinel,s=o._prev;for(;s!==o;)i.push(JSON.stringify(s,n)),s=s._prev;return"["+i.join(", ")+"]"}}function t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,i){if(r!=="_next"&&r!=="_prev")return i}return Qx=e,Qx}var Jx,gP;function Fye(){if(gP)return Jx;gP=1;let e=pi().Graph,t=Lye();Jx=r;let n=()=>1;function r(c,f){if(c.nodeCount()<=1)return[];let h=s(c,f||n);return i(h.graph,h.buckets,h.zeroIdx).flatMap(m=>c.outEdges(m.v,m.w))}function i(c,f,h){let p=[],m=f[f.length-1],y=f[0],x;for(;c.nodeCount();){for(;x=y.dequeue();)o(c,f,h,x);for(;x=m.dequeue();)o(c,f,h,x);if(c.nodeCount()){for(let k=f.length-2;k>0;--k)if(x=f[k].dequeue(),x){p=p.concat(o(c,f,h,x,!0));break}}}return p}function o(c,f,h,p,m){let y=m?[]:void 0;return c.inEdges(p.v).forEach(x=>{let k=c.edge(x),w=c.node(x.v);m&&y.push({v:x.v,w:x.w}),w.out-=k,a(f,h,w)}),c.outEdges(p.v).forEach(x=>{let k=c.edge(x),w=x.w,E=c.node(w);E.in-=k,a(f,h,E)}),c.removeNode(p.v),y}function s(c,f){let h=new e,p=0,m=0;c.nodes().forEach(k=>{h.setNode(k,{v:k,in:0,out:0})}),c.edges().forEach(k=>{let w=h.edge(k.v,k.w)||0,E=f(k),C=w+E;h.setEdge(k.v,k.w,C),m=Math.max(m,h.node(k.v).out+=E),p=Math.max(p,h.node(k.w).in+=E)});let y=u(m+p+3).map(()=>new t),x=p+1;return h.nodes().forEach(k=>{a(y,x,h.node(k))}),{graph:h,buckets:y,zeroIdx:x}}function a(c,f,h){h.out?h.in?c[h.out-h.in+f].enqueue(h):c[c.length-1].enqueue(h):c[0].enqueue(h)}function u(c){const f=[];for(let h=0;h<c;h++)f.push(h);return f}return Jx}var e0,yP;function pn(){if(yP)return e0;yP=1;let e=pi().Graph;e0={addBorderNode:f,addDummyNode:t,applyWithChunking:m,asNonCompoundGraph:r,buildLayerMatrix:a,intersectRect:s,mapValues:A,maxRank:y,normalizeRanks:u,notime:w,partition:x,pick:P,predecessorWeights:o,range:N,removeEmptyRanks:c,simplify:n,successorWeights:i,time:k,uniqueId:C,zipObject:O};function t(M,j,R,$){let F;do F=C($);while(M.hasNode(F));return R.dummy=j,M.setNode(F,R),F}function n(M){let j=new e().setGraph(M.graph());return M.nodes().forEach(R=>j.setNode(R,M.node(R))),M.edges().forEach(R=>{let $=j.edge(R.v,R.w)||{weight:0,minlen:1},F=M.edge(R);j.setEdge(R.v,R.w,{weight:$.weight+F.weight,minlen:Math.max($.minlen,F.minlen)})}),j}function r(M){let j=new e({multigraph:M.isMultigraph()}).setGraph(M.graph());return M.nodes().forEach(R=>{M.children(R).length||j.setNode(R,M.node(R))}),M.edges().forEach(R=>{j.setEdge(R,M.edge(R))}),j}function i(M){let j=M.nodes().map(R=>{let $={};return M.outEdges(R).forEach(F=>{$[F.w]=($[F.w]||0)+M.edge(F).weight}),$});return O(M.nodes(),j)}function o(M){let j=M.nodes().map(R=>{let $={};return M.inEdges(R).forEach(F=>{$[F.v]=($[F.v]||0)+M.edge(F).weight}),$});return O(M.nodes(),j)}function s(M,j){let R=M.x,$=M.y,F=j.x-R,H=j.y-$,I=M.width/2,Y=M.height/2;if(!F&&!H)throw new Error("Not possible to find intersection inside of the rectangle");let q,Z;return Math.abs(H)*I>Math.abs(F)*Y?(H<0&&(Y=-Y),q=Y*F/H,Z=Y):(F<0&&(I=-I),q=I,Z=I*H/F),{x:R+q,y:$+Z}}function a(M){let j=N(y(M)+1).map(()=>[]);return M.nodes().forEach(R=>{let $=M.node(R),F=$.rank;F!==void 0&&(j[F][$.order]=R)}),j}function u(M){let j=M.nodes().map($=>{let F=M.node($).rank;return F===void 0?Number.MAX_VALUE:F}),R=m(Math.min,j);M.nodes().forEach($=>{let F=M.node($);Object.hasOwn(F,"rank")&&(F.rank-=R)})}function c(M){let j=M.nodes().map(I=>M.node(I).rank),R=m(Math.min,j),$=[];M.nodes().forEach(I=>{let Y=M.node(I).rank-R;$[Y]||($[Y]=[]),$[Y].push(I)});let F=0,H=M.graph().nodeRankFactor;Array.from($).forEach((I,Y)=>{I===void 0&&Y%H!==0?--F:I!==void 0&&F&&I.forEach(q=>M.node(q).rank+=F)})}function f(M,j,R,$){let F={width:0,height:0};return arguments.length>=4&&(F.rank=R,F.order=$),t(M,"border",F,j)}function h(M,j=p){const R=[];for(let $=0;$<M.length;$+=j){const F=M.slice($,$+j);R.push(F)}return R}const p=65535;function m(M,j){if(j.length>p){const R=h(j);return M.apply(null,R.map($=>M.apply(null,$)))}else return M.apply(null,j)}function y(M){const R=M.nodes().map($=>{let F=M.node($).rank;return F===void 0?Number.MIN_VALUE:F});return m(Math.max,R)}function x(M,j){let R={lhs:[],rhs:[]};return M.forEach($=>{j($)?R.lhs.push($):R.rhs.push($)}),R}function k(M,j){let R=Date.now();try{return j()}finally{console.log(M+" time: "+(Date.now()-R)+"ms")}}function w(M,j){return j()}let E=0;function C(M){var j=++E;return toString(M)+j}function N(M,j,R=1){j==null&&(j=M,M=0);let $=H=>H<j;R<0&&($=H=>j<H);const F=[];for(let H=M;$(H);H+=R)F.push(H);return F}function P(M,j){const R={};for(const $ of j)M[$]!==void 0&&(R[$]=M[$]);return R}function A(M,j){let R=j;return typeof j=="string"&&(R=$=>$[j]),Object.entries(M).reduce(($,[F,H])=>($[F]=R(H,F),$),{})}function O(M,j){return M.reduce((R,$,F)=>(R[$]=j[F],R),{})}return e0}var t0,vP;function zye(){if(vP)return t0;vP=1;let e=Fye(),t=pn().uniqueId;t0={run:n,undo:i};function n(o){(o.graph().acyclicer==="greedy"?e(o,a(o)):r(o)).forEach(u=>{let c=o.edge(u);o.removeEdge(u),c.forwardName=u.name,c.reversed=!0,o.setEdge(u.w,u.v,c,t("rev"))});function a(u){return c=>u.edge(c).weight}}function r(o){let s=[],a={},u={};function c(f){Object.hasOwn(u,f)||(u[f]=!0,a[f]=!0,o.outEdges(f).forEach(h=>{Object.hasOwn(a,h.w)?s.push(h):c(h.w)}),delete a[f])}return o.nodes().forEach(c),s}function i(o){o.edges().forEach(s=>{let a=o.edge(s);if(a.reversed){o.removeEdge(s);let u=a.forwardName;delete a.reversed,delete a.forwardName,o.setEdge(s.w,s.v,a,u)}})}return t0}var n0,xP;function $ye(){if(xP)return n0;xP=1;let e=pn();n0={run:t,undo:r};function t(i){i.graph().dummyChains=[],i.edges().forEach(o=>n(i,o))}function n(i,o){let s=o.v,a=i.node(s).rank,u=o.w,c=i.node(u).rank,f=o.name,h=i.edge(o),p=h.labelRank;if(c===a+1)return;i.removeEdge(o);let m,y,x;for(x=0,++a;a<c;++x,++a)h.points=[],y={width:0,height:0,edgeLabel:h,edgeObj:o,rank:a},m=e.addDummyNode(i,"edge",y,"_d"),a===p&&(y.width=h.width,y.height=h.height,y.dummy="edge-label",y.labelpos=h.labelpos),i.setEdge(s,m,{weight:h.weight},f),x===0&&i.graph().dummyChains.push(m),s=m;i.setEdge(s,u,{weight:h.weight},f)}function r(i){i.graph().dummyChains.forEach(o=>{let s=i.node(o),a=s.edgeLabel,u;for(i.setEdge(s.edgeObj,a);s.dummy;)u=i.successors(o)[0],i.removeNode(o),a.points.push({x:s.x,y:s.y}),s.dummy==="edge-label"&&(a.x=s.x,a.y=s.y,a.width=s.width,a.height=s.height),o=u,s=i.node(o)})}return n0}var r0,wP;function Jp(){if(wP)return r0;wP=1;const{applyWithChunking:e}=pn();r0={longestPath:t,slack:n};function t(r){var i={};function o(s){var a=r.node(s);if(Object.hasOwn(i,s))return a.rank;i[s]=!0;let u=r.outEdges(s).map(f=>f==null?Number.POSITIVE_INFINITY:o(f.w)-r.edge(f).minlen);var c=e(Math.min,u);return c===Number.POSITIVE_INFINITY&&(c=0),a.rank=c}r.sources().forEach(o)}function n(r,i){return r.node(i.w).rank-r.node(i.v).rank-r.edge(i).minlen}return r0}var i0,bP;function g3(){if(bP)return i0;bP=1;var e=pi().Graph,t=Jp().slack;i0=n;function n(s){var a=new e({directed:!1}),u=s.nodes()[0],c=s.nodeCount();a.setNode(u,{});for(var f,h;r(a,s)<c;)f=i(a,s),h=a.hasNode(f.v)?t(s,f):-t(s,f),o(a,s,h);return a}function r(s,a){function u(c){a.nodeEdges(c).forEach(f=>{var h=f.v,p=c===h?f.w:h;!s.hasNode(p)&&!t(a,f)&&(s.setNode(p,{}),s.setEdge(c,p,{}),u(p))})}return s.nodes().forEach(u),s.nodeCount()}function i(s,a){return a.edges().reduce((c,f)=>{let h=Number.POSITIVE_INFINITY;return s.hasNode(f.v)!==s.hasNode(f.w)&&(h=t(a,f)),h<c[0]?[h,f]:c},[Number.POSITIVE_INFINITY,null])[1]}function o(s,a,u){s.nodes().forEach(c=>a.node(c).rank+=u)}return i0}var o0,kP;function Bye(){if(kP)return o0;kP=1;var e=g3(),t=Jp().slack,n=Jp().longestPath,r=pi().alg.preorder,i=pi().alg.postorder,o=pn().simplify;o0=s,s.initLowLimValues=f,s.initCutValues=a,s.calcCutValue=c,s.leaveEdge=p,s.enterEdge=m,s.exchangeEdges=y;function s(E){E=o(E),n(E);var C=e(E);f(C),a(C,E);for(var N,P;N=p(C);)P=m(C,E,N),y(C,E,N,P)}function a(E,C){var N=i(E,E.nodes());N=N.slice(0,N.length-1),N.forEach(P=>u(E,C,P))}function u(E,C,N){var P=E.node(N),A=P.parent;E.edge(N,A).cutvalue=c(E,C,N)}function c(E,C,N){var P=E.node(N),A=P.parent,O=!0,M=C.edge(N,A),j=0;return M||(O=!1,M=C.edge(A,N)),j=M.weight,C.nodeEdges(N).forEach(R=>{var $=R.v===N,F=$?R.w:R.v;if(F!==A){var H=$===O,I=C.edge(R).weight;if(j+=H?I:-I,k(E,N,F)){var Y=E.edge(N,F).cutvalue;j+=H?-Y:Y}}}),j}function f(E,C){arguments.length<2&&(C=E.nodes()[0]),h(E,{},1,C)}function h(E,C,N,P,A){var O=N,M=E.node(P);return C[P]=!0,E.neighbors(P).forEach(j=>{Object.hasOwn(C,j)||(N=h(E,C,N,j,P))}),M.low=O,M.lim=N++,A?M.parent=A:delete M.parent,N}function p(E){return E.edges().find(C=>E.edge(C).cutvalue<0)}function m(E,C,N){var P=N.v,A=N.w;C.hasEdge(P,A)||(P=N.w,A=N.v);var O=E.node(P),M=E.node(A),j=O,R=!1;O.lim>M.lim&&(j=M,R=!0);var $=C.edges().filter(F=>R===w(E,E.node(F.v),j)&&R!==w(E,E.node(F.w),j));return $.reduce((F,H)=>t(C,H)<t(C,F)?H:F)}function y(E,C,N,P){var A=N.v,O=N.w;E.removeEdge(A,O),E.setEdge(P.v,P.w,{}),f(E),a(E,C),x(E,C)}function x(E,C){var N=E.nodes().find(A=>!C.node(A).parent),P=r(E,N);P=P.slice(1),P.forEach(A=>{var O=E.node(A).parent,M=C.edge(A,O),j=!1;M||(M=C.edge(O,A),j=!0),C.node(A).rank=C.node(O).rank+(j?M.minlen:-M.minlen)})}function k(E,C,N){return E.hasEdge(C,N)}function w(E,C,N){return N.low<=C.lim&&C.lim<=N.lim}return o0}var s0,SP;function Vye(){if(SP)return s0;SP=1;var e=Jp(),t=e.longestPath,n=g3(),r=Bye();s0=i;function i(u){switch(u.graph().ranker){case"network-simplex":a(u);break;case"tight-tree":s(u);break;case"longest-path":o(u);break;default:a(u)}}var o=t;function s(u){t(u),n(u)}function a(u){r(u)}return s0}var a0,EP;function Wye(){if(EP)return a0;EP=1,a0=e;function e(r){let i=n(r);r.graph().dummyChains.forEach(o=>{let s=r.node(o),a=s.edgeObj,u=t(r,i,a.v,a.w),c=u.path,f=u.lca,h=0,p=c[h],m=!0;for(;o!==a.w;){if(s=r.node(o),m){for(;(p=c[h])!==f&&r.node(p).maxRank<s.rank;)h++;p===f&&(m=!1)}if(!m){for(;h<c.length-1&&r.node(p=c[h+1]).minRank<=s.rank;)h++;p=c[h]}r.setParent(o,p),o=r.successors(o)[0]}})}function t(r,i,o,s){let a=[],u=[],c=Math.min(i[o].low,i[s].low),f=Math.max(i[o].lim,i[s].lim),h,p;h=o;do h=r.parent(h),a.push(h);while(h&&(i[h].low>c||f>i[h].lim));for(p=h,h=s;(h=r.parent(h))!==p;)u.push(h);return{path:a.concat(u.reverse()),lca:p}}function n(r){let i={},o=0;function s(a){let u=o;r.children(a).forEach(s),i[a]={low:u,lim:o++}}return r.children().forEach(s),i}return a0}var l0,CP;function Uye(){if(CP)return l0;CP=1;let e=pn();l0={run:t,cleanup:o};function t(s){let a=e.addDummyNode(s,"root",{},"_root"),u=r(s),c=Object.values(u),f=e.applyWithChunking(Math.max,c)-1,h=2*f+1;s.graph().nestingRoot=a,s.edges().forEach(m=>s.edge(m).minlen*=h);let p=i(s)+1;s.children().forEach(m=>n(s,a,h,p,f,u,m)),s.graph().nodeRankFactor=h}function n(s,a,u,c,f,h,p){let m=s.children(p);if(!m.length){p!==a&&s.setEdge(a,p,{weight:0,minlen:u});return}let y=e.addBorderNode(s,"_bt"),x=e.addBorderNode(s,"_bb"),k=s.node(p);s.setParent(y,p),k.borderTop=y,s.setParent(x,p),k.borderBottom=x,m.forEach(w=>{n(s,a,u,c,f,h,w);let E=s.node(w),C=E.borderTop?E.borderTop:w,N=E.borderBottom?E.borderBottom:w,P=E.borderTop?c:2*c,A=C!==N?1:f-h[p]+1;s.setEdge(y,C,{weight:P,minlen:A,nestingEdge:!0}),s.setEdge(N,x,{weight:P,minlen:A,nestingEdge:!0})}),s.parent(p)||s.setEdge(a,y,{weight:0,minlen:f+h[p]})}function r(s){var a={};function u(c,f){var h=s.children(c);h&&h.length&&h.forEach(p=>u(p,f+1)),a[c]=f}return s.children().forEach(c=>u(c,1)),a}function i(s){return s.edges().reduce((a,u)=>a+s.edge(u).weight,0)}function o(s){var a=s.graph();s.removeNode(a.nestingRoot),delete a.nestingRoot,s.edges().forEach(u=>{var c=s.edge(u);c.nestingEdge&&s.removeEdge(u)})}return l0}var u0,_P;function Hye(){if(_P)return u0;_P=1;let e=pn();u0=t;function t(r){function i(o){let s=r.children(o),a=r.node(o);if(s.length&&s.forEach(i),Object.hasOwn(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(let u=a.minRank,c=a.maxRank+1;u<c;++u)n(r,"borderLeft","_bl",o,a,u),n(r,"borderRight","_br",o,a,u)}}r.children().forEach(i)}function n(r,i,o,s,a,u){let c={width:0,height:0,rank:u,borderType:i},f=a[i][u-1],h=e.addDummyNode(r,"border",c,o);a[i][u]=h,r.setParent(h,s),f&&r.setEdge(f,h,{weight:1})}return u0}var c0,NP;function Yye(){if(NP)return c0;NP=1,c0={adjust:e,undo:t};function e(u){let c=u.graph().rankdir.toLowerCase();(c==="lr"||c==="rl")&&n(u)}function t(u){let c=u.graph().rankdir.toLowerCase();(c==="bt"||c==="rl")&&i(u),(c==="lr"||c==="rl")&&(s(u),n(u))}function n(u){u.nodes().forEach(c=>r(u.node(c))),u.edges().forEach(c=>r(u.edge(c)))}function r(u){let c=u.width;u.width=u.height,u.height=c}function i(u){u.nodes().forEach(c=>o(u.node(c))),u.edges().forEach(c=>{let f=u.edge(c);f.points.forEach(o),Object.hasOwn(f,"y")&&o(f)})}function o(u){u.y=-u.y}function s(u){u.nodes().forEach(c=>a(u.node(c))),u.edges().forEach(c=>{let f=u.edge(c);f.points.forEach(a),Object.hasOwn(f,"x")&&a(f)})}function a(u){let c=u.x;u.x=u.y,u.y=c}return c0}var d0,TP;function qye(){if(TP)return d0;TP=1;let e=pn();d0=t;function t(n){let r={},i=n.nodes().filter(f=>!n.children(f).length),o=i.map(f=>n.node(f).rank),s=e.applyWithChunking(Math.max,o),a=e.range(s+1).map(()=>[]);function u(f){if(r[f])return;r[f]=!0;let h=n.node(f);a[h.rank].push(f),n.successors(f).forEach(u)}return i.sort((f,h)=>n.node(f).rank-n.node(h).rank).forEach(u),a}return d0}var f0,AP;function Gye(){if(AP)return f0;AP=1;let e=pn().zipObject;f0=t;function t(r,i){let o=0;for(let s=1;s<i.length;++s)o+=n(r,i[s-1],i[s]);return o}function n(r,i,o){let s=e(o,o.map((p,m)=>m)),a=i.flatMap(p=>r.outEdges(p).map(m=>({pos:s[m.w],weight:r.edge(m).weight})).sort((m,y)=>m.pos-y.pos)),u=1;for(;u<o.length;)u<<=1;let c=2*u-1;u-=1;let f=new Array(c).fill(0),h=0;return a.forEach(p=>{let m=p.pos+u;f[m]+=p.weight;let y=0;for(;m>0;)m%2&&(y+=f[m+1]),m=m-1>>1,f[m]+=p.weight;h+=p.weight*y}),h}return f0}var h0,PP;function Zye(){if(PP)return h0;PP=1,h0=e;function e(t,n=[]){return n.map(r=>{let i=t.inEdges(r);if(i.length){let o=i.reduce((s,a)=>{let u=t.edge(a),c=t.node(a.v);return{sum:s.sum+u.weight*c.order,weight:s.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:r}})}return h0}var p0,RP;function Kye(){if(RP)return p0;RP=1;let e=pn();p0=t;function t(i,o){let s={};i.forEach((u,c)=>{let f=s[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:c};u.barycenter!==void 0&&(f.barycenter=u.barycenter,f.weight=u.weight)}),o.edges().forEach(u=>{let c=s[u.v],f=s[u.w];c!==void 0&&f!==void 0&&(f.indegree++,c.out.push(s[u.w]))});let a=Object.values(s).filter(u=>!u.indegree);return n(a)}function n(i){let o=[];function s(u){return c=>{c.merged||(c.barycenter===void 0||u.barycenter===void 0||c.barycenter>=u.barycenter)&&r(u,c)}}function a(u){return c=>{c.in.push(u),--c.indegree===0&&i.push(c)}}for(;i.length;){let u=i.pop();o.push(u),u.in.reverse().forEach(s(u)),u.out.forEach(a(u))}return o.filter(u=>!u.merged).map(u=>e.pick(u,["vs","i","barycenter","weight"]))}function r(i,o){let s=0,a=0;i.weight&&(s+=i.barycenter*i.weight,a+=i.weight),o.weight&&(s+=o.barycenter*o.weight,a+=o.weight),i.vs=o.vs.concat(i.vs),i.barycenter=s/a,i.weight=a,i.i=Math.min(o.i,i.i),o.merged=!0}return p0}var m0,MP;function Xye(){if(MP)return m0;MP=1;let e=pn();m0=t;function t(i,o){let s=e.partition(i,y=>Object.hasOwn(y,"barycenter")),a=s.lhs,u=s.rhs.sort((y,x)=>x.i-y.i),c=[],f=0,h=0,p=0;a.sort(r(!!o)),p=n(c,u,p),a.forEach(y=>{p+=y.vs.length,c.push(y.vs),f+=y.barycenter*y.weight,h+=y.weight,p=n(c,u,p)});let m={vs:c.flat(!0)};return h&&(m.barycenter=f/h,m.weight=h),m}function n(i,o,s){let a;for(;o.length&&(a=o[o.length-1]).i<=s;)o.pop(),i.push(a.vs),s++;return s}function r(i){return(o,s)=>o.barycenter<s.barycenter?-1:o.barycenter>s.barycenter?1:i?s.i-o.i:o.i-s.i}return m0}var g0,DP;function Qye(){if(DP)return g0;DP=1;let e=Zye(),t=Kye(),n=Xye();g0=r;function r(s,a,u,c){let f=s.children(a),h=s.node(a),p=h?h.borderLeft:void 0,m=h?h.borderRight:void 0,y={};p&&(f=f.filter(E=>E!==p&&E!==m));let x=e(s,f);x.forEach(E=>{if(s.children(E.v).length){let C=r(s,E.v,u,c);y[E.v]=C,Object.hasOwn(C,"barycenter")&&o(E,C)}});let k=t(x,u);i(k,y);let w=n(k,c);if(p&&(w.vs=[p,w.vs,m].flat(!0),s.predecessors(p).length)){let E=s.node(s.predecessors(p)[0]),C=s.node(s.predecessors(m)[0]);Object.hasOwn(w,"barycenter")||(w.barycenter=0,w.weight=0),w.barycenter=(w.barycenter*w.weight+E.order+C.order)/(w.weight+2),w.weight+=2}return w}function i(s,a){s.forEach(u=>{u.vs=u.vs.flatMap(c=>a[c]?a[c].vs:c)})}function o(s,a){s.barycenter!==void 0?(s.barycenter=(s.barycenter*s.weight+a.barycenter*a.weight)/(s.weight+a.weight),s.weight+=a.weight):(s.barycenter=a.barycenter,s.weight=a.weight)}return g0}var y0,OP;function Jye(){if(OP)return y0;OP=1;let e=pi().Graph,t=pn();y0=n;function n(i,o,s){let a=r(i),u=new e({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(c=>i.node(c));return i.nodes().forEach(c=>{let f=i.node(c),h=i.parent(c);(f.rank===o||f.minRank<=o&&o<=f.maxRank)&&(u.setNode(c),u.setParent(c,h||a),i[s](c).forEach(p=>{let m=p.v===c?p.w:p.v,y=u.edge(m,c),x=y!==void 0?y.weight:0;u.setEdge(m,c,{weight:i.edge(p).weight+x})}),Object.hasOwn(f,"minRank")&&u.setNode(c,{borderLeft:f.borderLeft[o],borderRight:f.borderRight[o]}))}),u}function r(i){for(var o;i.hasNode(o=t.uniqueId("_root")););return o}return y0}var v0,IP;function eve(){if(IP)return v0;IP=1,v0=e;function e(t,n,r){let i={},o;r.forEach(s=>{let a=t.parent(s),u,c;for(;a;){if(u=t.parent(a),u?(c=i[u],i[u]=a):(c=o,o=a),c&&c!==a){n.setEdge(c,a);return}a=u}})}return v0}var x0,jP;function tve(){if(jP)return x0;jP=1;let e=qye(),t=Gye(),n=Qye(),r=Jye(),i=eve(),o=pi().Graph,s=pn();x0=a;function a(h,p){if(p&&typeof p.customOrder=="function"){p.customOrder(h,a);return}let m=s.maxRank(h),y=u(h,s.range(1,m+1),"inEdges"),x=u(h,s.range(m-1,-1,-1),"outEdges"),k=e(h);if(f(h,k),p&&p.disableOptimalOrderHeuristic)return;let w=Number.POSITIVE_INFINITY,E;for(let C=0,N=0;N<4;++C,++N){c(C%2?y:x,C%4>=2),k=s.buildLayerMatrix(h);let P=t(h,k);P<w&&(N=0,E=Object.assign({},k),w=P)}f(h,E)}function u(h,p,m){return p.map(function(y){return r(h,y,m)})}function c(h,p){let m=new o;h.forEach(function(y){let x=y.graph().root,k=n(y,x,m,p);k.vs.forEach((w,E)=>y.node(w).order=E),i(y,m,k.vs)})}function f(h,p){Object.values(p).forEach(m=>m.forEach((y,x)=>h.node(y).order=x))}return x0}var w0,LP;function nve(){if(LP)return w0;LP=1;let e=pi().Graph,t=pn();w0={positionX:m,findType1Conflicts:n,findType2Conflicts:r,addConflict:o,hasConflict:s,verticalAlignment:a,horizontalCompaction:u,alignCoordinates:h,findSmallestWidthAlignment:f,balance:p};function n(k,w){let E={};function C(N,P){let A=0,O=0,M=N.length,j=P[P.length-1];return P.forEach((R,$)=>{let F=i(k,R),H=F?k.node(F).order:M;(F||R===j)&&(P.slice(O,$+1).forEach(I=>{k.predecessors(I).forEach(Y=>{let q=k.node(Y),Z=q.order;(Z<A||H<Z)&&!(q.dummy&&k.node(I).dummy)&&o(E,Y,I)})}),O=$+1,A=H)}),P}return w.length&&w.reduce(C),E}function r(k,w){let E={};function C(P,A,O,M,j){let R;t.range(A,O).forEach($=>{R=P[$],k.node(R).dummy&&k.predecessors(R).forEach(F=>{let H=k.node(F);H.dummy&&(H.order<M||H.order>j)&&o(E,F,R)})})}function N(P,A){let O=-1,M,j=0;return A.forEach((R,$)=>{if(k.node(R).dummy==="border"){let F=k.predecessors(R);F.length&&(M=k.node(F[0]).order,C(A,j,$,O,M),j=$,O=M)}C(A,j,A.length,M,P.length)}),A}return w.length&&w.reduce(N),E}function i(k,w){if(k.node(w).dummy)return k.predecessors(w).find(E=>k.node(E).dummy)}function o(k,w,E){if(w>E){let N=w;w=E,E=N}let C=k[w];C||(k[w]=C={}),C[E]=!0}function s(k,w,E){if(w>E){let C=w;w=E,E=C}return!!k[w]&&Object.hasOwn(k[w],E)}function a(k,w,E,C){let N={},P={},A={};return w.forEach(O=>{O.forEach((M,j)=>{N[M]=M,P[M]=M,A[M]=j})}),w.forEach(O=>{let M=-1;O.forEach(j=>{let R=C(j);if(R.length){R=R.sort((F,H)=>A[F]-A[H]);let $=(R.length-1)/2;for(let F=Math.floor($),H=Math.ceil($);F<=H;++F){let I=R[F];P[j]===j&&M<A[I]&&!s(E,j,I)&&(P[I]=j,P[j]=N[j]=N[I],M=A[I])}}})}),{root:N,align:P}}function u(k,w,E,C,N){let P={},A=c(k,w,E,N),O=N?"borderLeft":"borderRight";function M($,F){let H=A.nodes(),I=H.pop(),Y={};for(;I;)Y[I]?$(I):(Y[I]=!0,H.push(I),H=H.concat(F(I))),I=H.pop()}function j($){P[$]=A.inEdges($).reduce((F,H)=>Math.max(F,P[H.v]+A.edge(H)),0)}function R($){let F=A.outEdges($).reduce((I,Y)=>Math.min(I,P[Y.w]-A.edge(Y)),Number.POSITIVE_INFINITY),H=k.node($);F!==Number.POSITIVE_INFINITY&&H.borderType!==O&&(P[$]=Math.max(P[$],F))}return M(j,A.predecessors.bind(A)),M(R,A.successors.bind(A)),Object.keys(C).forEach($=>P[$]=P[E[$]]),P}function c(k,w,E,C){let N=new e,P=k.graph(),A=y(P.nodesep,P.edgesep,C);return w.forEach(O=>{let M;O.forEach(j=>{let R=E[j];if(N.setNode(R),M){var $=E[M],F=N.edge($,R);N.setEdge($,R,Math.max(A(k,j,M),F||0))}M=j})}),N}function f(k,w){return Object.values(w).reduce((E,C)=>{let N=Number.NEGATIVE_INFINITY,P=Number.POSITIVE_INFINITY;Object.entries(C).forEach(([O,M])=>{let j=x(k,O)/2;N=Math.max(M+j,N),P=Math.min(M-j,P)});const A=N-P;return A<E[0]&&(E=[A,C]),E},[Number.POSITIVE_INFINITY,null])[1]}function h(k,w){let E=Object.values(w),C=t.applyWithChunking(Math.min,E),N=t.applyWithChunking(Math.max,E);["u","d"].forEach(P=>{["l","r"].forEach(A=>{let O=P+A,M=k[O];if(M===w)return;let j=Object.values(M),R=C-t.applyWithChunking(Math.min,j);A!=="l"&&(R=N-t.applyWithChunking(Math.max,j)),R&&(k[O]=t.mapValues(M,$=>$+R))})})}function p(k,w){return t.mapValues(k.ul,(E,C)=>{if(w)return k[w.toLowerCase()][C];{let N=Object.values(k).map(P=>P[C]).sort((P,A)=>P-A);return(N[1]+N[2])/2}})}function m(k){let w=t.buildLayerMatrix(k),E=Object.assign(n(k,w),r(k,w)),C={},N;["u","d"].forEach(A=>{N=A==="u"?w:Object.values(w).reverse(),["l","r"].forEach(O=>{O==="r"&&(N=N.map($=>Object.values($).reverse()));let M=(A==="u"?k.predecessors:k.successors).bind(k),j=a(k,N,E,M),R=u(k,N,j.root,j.align,O==="r");O==="r"&&(R=t.mapValues(R,$=>-$)),C[A+O]=R})});let P=f(k,C);return h(C,P),p(C,k.graph().align)}function y(k,w,E){return(C,N,P)=>{let A=C.node(N),O=C.node(P),M=0,j;if(M+=A.width/2,Object.hasOwn(A,"labelpos"))switch(A.labelpos.toLowerCase()){case"l":j=-A.width/2;break;case"r":j=A.width/2;break}if(j&&(M+=E?j:-j),j=0,M+=(A.dummy?w:k)/2,M+=(O.dummy?w:k)/2,M+=O.width/2,Object.hasOwn(O,"labelpos"))switch(O.labelpos.toLowerCase()){case"l":j=O.width/2;break;case"r":j=-O.width/2;break}return j&&(M+=E?j:-j),j=0,M}}function x(k,w){return k.node(w).width}return w0}var b0,FP;function rve(){if(FP)return b0;FP=1;let e=pn(),t=nve().positionX;b0=n;function n(i){i=e.asNonCompoundGraph(i),r(i),Object.entries(t(i)).forEach(([o,s])=>i.node(o).x=s)}function r(i){let o=e.buildLayerMatrix(i),s=i.graph().ranksep,a=0;o.forEach(u=>{const c=u.reduce((f,h)=>{const p=i.node(h).height;return f>p?f:p},0);u.forEach(f=>i.node(f).y=a+c/2),a+=c+s})}return b0}var k0,zP;function ive(){if(zP)return k0;zP=1;let e=zye(),t=$ye(),n=Vye(),r=pn().normalizeRanks,i=Wye(),o=pn().removeEmptyRanks,s=Uye(),a=Hye(),u=Yye(),c=tve(),f=rve(),h=pn(),p=pi().Graph;k0=m;function m(D,G){let K=G&&G.debugTiming?h.time:h.notime;K("layout",()=>{let J=K(" buildLayoutGraph",()=>M(D));K(" runLayout",()=>y(J,K,G)),K(" updateInputGraph",()=>x(D,J))})}function y(D,G,K){G(" makeSpaceForEdgeLabels",()=>j(D)),G(" removeSelfEdges",()=>B(D)),G(" acyclic",()=>e.run(D)),G(" nestingGraph.run",()=>s.run(D)),G(" rank",()=>n(h.asNonCompoundGraph(D))),G(" injectEdgeLabelProxies",()=>R(D)),G(" removeEmptyRanks",()=>o(D)),G(" nestingGraph.cleanup",()=>s.cleanup(D)),G(" normalizeRanks",()=>r(D)),G(" assignRankMinMax",()=>$(D)),G(" removeEdgeLabelProxies",()=>F(D)),G(" normalize.run",()=>t.run(D)),G(" parentDummyChains",()=>i(D)),G(" addBorderSegments",()=>a(D)),G(" order",()=>c(D,K)),G(" insertSelfEdges",()=>W(D)),G(" adjustCoordinateSystem",()=>u.adjust(D)),G(" position",()=>f(D)),G(" positionSelfEdges",()=>L(D)),G(" removeBorderNodes",()=>Z(D)),G(" normalize.undo",()=>t.undo(D)),G(" fixupEdgeLabelCoords",()=>Y(D)),G(" undoCoordinateSystem",()=>u.undo(D)),G(" translateGraph",()=>H(D)),G(" assignNodeIntersects",()=>I(D)),G(" reversePoints",()=>q(D)),G(" acyclic.undo",()=>e.undo(D))}function x(D,G){D.nodes().forEach(K=>{let J=D.node(K),ee=G.node(K);J&&(J.x=ee.x,J.y=ee.y,J.rank=ee.rank,G.children(K).length&&(J.width=ee.width,J.height=ee.height))}),D.edges().forEach(K=>{let J=D.edge(K),ee=G.edge(K);J.points=ee.points,Object.hasOwn(ee,"x")&&(J.x=ee.x,J.y=ee.y)}),D.graph().width=G.graph().width,D.graph().height=G.graph().height}let k=["nodesep","edgesep","ranksep","marginx","marginy"],w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},E=["acyclicer","ranker","rankdir","align"],C=["width","height"],N={width:0,height:0},P=["minlen","weight","width","height","labeloffset"],A={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},O=["labelpos"];function M(D){let G=new p({multigraph:!0,compound:!0}),K=V(D.graph());return G.setGraph(Object.assign({},w,U(K,k),h.pick(K,E))),D.nodes().forEach(J=>{let ee=V(D.node(J));const re=U(ee,C);Object.keys(N).forEach(ue=>{re[ue]===void 0&&(re[ue]=N[ue])}),G.setNode(J,re),G.setParent(J,D.parent(J))}),D.edges().forEach(J=>{let ee=V(D.edge(J));G.setEdge(J,Object.assign({},A,U(ee,P),h.pick(ee,O)))}),G}function j(D){let G=D.graph();G.ranksep/=2,D.edges().forEach(K=>{let J=D.edge(K);J.minlen*=2,J.labelpos.toLowerCase()!=="c"&&(G.rankdir==="TB"||G.rankdir==="BT"?J.width+=J.labeloffset:J.height+=J.labeloffset)})}function R(D){D.edges().forEach(G=>{let K=D.edge(G);if(K.width&&K.height){let J=D.node(G.v),re={rank:(D.node(G.w).rank-J.rank)/2+J.rank,e:G};h.addDummyNode(D,"edge-proxy",re,"_ep")}})}function $(D){let G=0;D.nodes().forEach(K=>{let J=D.node(K);J.borderTop&&(J.minRank=D.node(J.borderTop).rank,J.maxRank=D.node(J.borderBottom).rank,G=Math.max(G,J.maxRank))}),D.graph().maxRank=G}function F(D){D.nodes().forEach(G=>{let K=D.node(G);K.dummy==="edge-proxy"&&(D.edge(K.e).labelRank=K.rank,D.removeNode(G))})}function H(D){let G=Number.POSITIVE_INFINITY,K=0,J=Number.POSITIVE_INFINITY,ee=0,re=D.graph(),ue=re.marginx||0,he=re.marginy||0;function be(fe){let ve=fe.x,Me=fe.y,$e=fe.width,ct=fe.height;G=Math.min(G,ve-$e/2),K=Math.max(K,ve+$e/2),J=Math.min(J,Me-ct/2),ee=Math.max(ee,Me+ct/2)}D.nodes().forEach(fe=>be(D.node(fe))),D.edges().forEach(fe=>{let ve=D.edge(fe);Object.hasOwn(ve,"x")&&be(ve)}),G-=ue,J-=he,D.nodes().forEach(fe=>{let ve=D.node(fe);ve.x-=G,ve.y-=J}),D.edges().forEach(fe=>{let ve=D.edge(fe);ve.points.forEach(Me=>{Me.x-=G,Me.y-=J}),Object.hasOwn(ve,"x")&&(ve.x-=G),Object.hasOwn(ve,"y")&&(ve.y-=J)}),re.width=K-G+ue,re.height=ee-J+he}function I(D){D.edges().forEach(G=>{let K=D.edge(G),J=D.node(G.v),ee=D.node(G.w),re,ue;K.points?(re=K.points[0],ue=K.points[K.points.length-1]):(K.points=[],re=ee,ue=J),K.points.unshift(h.intersectRect(J,re)),K.points.push(h.intersectRect(ee,ue))})}function Y(D){D.edges().forEach(G=>{let K=D.edge(G);if(Object.hasOwn(K,"x"))switch((K.labelpos==="l"||K.labelpos==="r")&&(K.width-=K.labeloffset),K.labelpos){case"l":K.x-=K.width/2+K.labeloffset;break;case"r":K.x+=K.width/2+K.labeloffset;break}})}function q(D){D.edges().forEach(G=>{let K=D.edge(G);K.reversed&&K.points.reverse()})}function Z(D){D.nodes().forEach(G=>{if(D.children(G).length){let K=D.node(G),J=D.node(K.borderTop),ee=D.node(K.borderBottom),re=D.node(K.borderLeft[K.borderLeft.length-1]),ue=D.node(K.borderRight[K.borderRight.length-1]);K.width=Math.abs(ue.x-re.x),K.height=Math.abs(ee.y-J.y),K.x=re.x+K.width/2,K.y=J.y+K.height/2}}),D.nodes().forEach(G=>{D.node(G).dummy==="border"&&D.removeNode(G)})}function B(D){D.edges().forEach(G=>{if(G.v===G.w){var K=D.node(G.v);K.selfEdges||(K.selfEdges=[]),K.selfEdges.push({e:G,label:D.edge(G)}),D.removeEdge(G)}})}function W(D){var G=h.buildLayerMatrix(D);G.forEach(K=>{var J=0;K.forEach((ee,re)=>{var ue=D.node(ee);ue.order=re+J,(ue.selfEdges||[]).forEach(he=>{h.addDummyNode(D,"selfedge",{width:he.label.width,height:he.label.height,rank:ue.rank,order:re+ ++J,e:he.e,label:he.label},"_se")}),delete ue.selfEdges})})}function L(D){D.nodes().forEach(G=>{var K=D.node(G);if(K.dummy==="selfedge"){var J=D.node(K.e.v),ee=J.x+J.width/2,re=J.y,ue=K.x-ee,he=J.height/2;D.setEdge(K.e,K.label),D.removeNode(G),K.label.points=[{x:ee+2*ue/3,y:re-he},{x:ee+5*ue/6,y:re-he},{x:ee+ue,y:re},{x:ee+5*ue/6,y:re+he},{x:ee+2*ue/3,y:re+he}],K.label.x=K.x,K.label.y=K.y}})}function U(D,G){return h.mapValues(h.pick(D,G),Number)}function V(D){var G={};return D&&Object.entries(D).forEach(([K,J])=>{typeof K=="string"&&(K=K.toLowerCase()),G[K]=J}),G}return k0}var S0,$P;function ove(){if($P)return S0;$P=1;let e=pn(),t=pi().Graph;S0={debugOrdering:n};function n(r){let i=e.buildLayerMatrix(r),o=new t({compound:!0,multigraph:!0}).setGraph({});return r.nodes().forEach(s=>{o.setNode(s,{label:s}),o.setParent(s,"layer"+r.node(s).rank)}),r.edges().forEach(s=>o.setEdge(s.v,s.w,{},s.name)),i.forEach((s,a)=>{let u="layer"+a;o.setNode(u,{rank:"same"}),s.reduce((c,f)=>(o.setEdge(c,f,{style:"invis"}),f))}),o}return S0}var E0,BP;function sve(){return BP||(BP=1,E0="1.1.4"),E0}var C0,VP;function ave(){return VP||(VP=1,C0={graphlib:pi(),layout:ive(),debug:ove(),util:{time:pn().time,notime:pn().notime},version:sve()}),C0}var lve=ave();const WP=Zl(lve);function UP(e){let t=[];if(!e)return t;function n(r,i){if("ref"in r){const{ref:o,query:s}=r;t.push({ref:o,query:s,conj:i})}if("and"in r)for(const o of r.and)n({...o},"and");if("or"in r)for(const o of r.or)n({...o},"or")}return n(e),t}const HP=(e,t)=>{const n=new WP.graphlib.Graph().setDefaultEdgeLabel(()=>({}));return n.setGraph({rankdir:"TB"}),t.forEach(r=>n.setEdge(r.source,r.target)),e.forEach(r=>{var i,o;return n.setNode(r.id,{...r,width:((i=r.measured)==null?void 0:i.width)??274,height:((o=r.measured)==null?void 0:o.height)??100})}),WP.layout(n),{nodes:e.map(r=>{var a,u;const i=n.node(r.id),o=i.x-(((a=r.measured)==null?void 0:a.width)??274)/2,s=i.y-(((u=r.measured)==null?void 0:u.height)??100)/2;return{...r,position:{x:o,y:s}}}),edges:t}},Vh={animated:!0,markerEnd:{type:vd.ArrowClosed,width:20,height:20,color:"#8e8e8e"}},uve=({stepGraph:e,stepSubscriberGraph:t})=>{if(!e)return{nodes:[],edges:[]};const{initial:n,...r}=e;if(!n.length)return{nodes:[],edges:[]};let i=[],o=[];for(const[u,c]of n.entries()){const h=c.step.id,p=[c,...(r==null?void 0:r[h])||[]].reduce((k,w,E)=>{var N;const C={...w.step,label:w.step.id,type:"default-node",id:i.some(P=>P.id===w.step.id)?`${w.step.id}-${E}`:w.step.id};if((N=w.config)!=null&&N.when){const P=UP(w.config.when),A={id:crypto.randomUUID(),conditions:P,type:"condition-node"};k.push(A)}return k.push(C),k},[]),m=[...p].map((k,w)=>{const E=t==null?void 0:t[k.id];return{id:k.id,position:{x:u*300,y:w*100},type:k.type,data:{conditions:k.conditions,label:k.label,description:k.description,withoutTopHandle:E!=null&&E[k.id]?!1:w===0,withoutBottomHandle:E?!1:w===p.length-1}}});i=[...i,...m];const x=[...p].slice(0,-1).map((k,w)=>({id:`e${k.id}-${p[w+1].id}`,source:k.id,target:p[w+1].id,...Vh}));o=[...o,...x]}if(!t||!Object.keys(t).length){const{nodes:u,edges:c}=HP(i,o);return{nodes:u,edges:c}}for(const[u,c]of Object.entries(t)){const{initial:f,...h}=c;if(f.length)for(const[p,m]of f.entries()){const x=m.step.id,k=[m,...(h==null?void 0:h[x])||[]].map(j=>j.step),w=[m,...(h==null?void 0:h[x])||[]].reduce((j,R,$)=>{var H;const F={...R.step,label:R.step.id,type:"default-node",id:i.some(I=>I.id===R.step.id)?`${R.step.id}-${$}`:R.step.id};if((H=R.config)!=null&&H.when){const I=UP(R.config.when),Y={id:crypto.randomUUID(),conditions:I,type:"condition-node"};j.push(Y)}return j.push(F),j},[]),E=[...w].map((j,R)=>{const $=t==null?void 0:t[j.id];return{id:j.id,position:{x:p*300+300,y:R*100+100},type:j.type,data:{conditions:j.conditions,label:j.label,description:j.description,withoutBottomHandle:k.some(({id:F})=>F===j.label&&F!==j.id)||$?!1:R===w.length-1}}});i=[...i,...E];const N=[...w].slice(0,-1).map((j,R)=>({id:`e${j.id}-${w[R+1].id}`,source:j.id,target:w[R+1].id,...Vh})),P=w[0],A=w[w.length-1],O=u===P.id?[]:[{id:`e${u}-${P.id}`,source:u,target:P.id,...Vh}],M=k.some(({id:j})=>j===A.label&&j!==A.id)?[{id:`e${A.id}-${u}`,source:A.id,target:u,...Vh}]:[];o=[...o,...O,...N,...M]}}const{nodes:s,edges:a}=HP(i,o);return{nodes:s,edges:a}};function cve({data:e}){const{conditions:t}=e;return v.jsxs("div",{className:Te("bg-mastra-bg-3 rounded-md min-w-[154.23px] max-w-[274px] flex flex-col p-2 gap-2"),children:[v.jsx(bs,{type:"target",position:We.Top,style:{visibility:"hidden"}}),t.map((n,r)=>{var i;return v.jsx(S.Fragment,{children:n.ref.step?v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(hn,{size:"xs",weight:"medium",className:"text-mastra-el-3 bg-mastra-bg-11 my-auto block rounded-[0.125rem] px-2 py-1 text-[10px]",children:((i=n.conj)==null?void 0:i.toLocaleUpperCase())||"WHEN"}),v.jsxs(hn,{size:"xs",className:" text-mastra-el-3",children:[n.ref.step.id||n.ref.step,"'s ",n.ref.path]}),Object.entries(n.query).map(([o,s])=>v.jsxs("div",{className:"flex items-center gap-0.5",children:[v.jsx(hn,{size:"xs",className:" text-mastra-el-3 lowercase",children:o}),v.jsx(hn,{size:"xs",className:"text-mastra-el-3 py-[0.19rem]",children:s})]},`${o}-${s}`))]}):null},`${n.ref.path}-${r}`)}),v.jsx(bs,{type:"source",position:We.Bottom,style:{visibility:"hidden"}})]})}function dve({data:e}){const{label:t,description:n,withoutTopHandle:r,withoutBottomHandle:i}=e;return v.jsxs("div",{className:Te("bg-mastra-bg-8 rounded-md w-[274px]"),children:[!r&&v.jsx(bs,{type:"target",position:We.Top,style:{visibility:"hidden"}}),v.jsx("div",{className:"p-2",children:v.jsxs("div",{className:"text-sm bg-mastra-bg-9 flex items-center gap-[6px] rounded-sm p-2",children:[v.jsx(qB,{className:"text-current w-4 h-4"}),v.jsx(hn,{size:"xs",weight:"medium",className:"text-mastra-el-6 capitalize",children:t})]})}),n&&v.jsx("div",{className:"bg-mastra-bg-4 rounded-b-md p-2 text-[10px] text-left text-mastra-el-4",children:n}),!i&&v.jsx(bs,{type:"source",position:We.Bottom,style:{visibility:"hidden"}})]})}function fve({workflow:e}){const{nodes:t,edges:n}=uve(e),[r,i,o]=Qge(t),[s]=Jge(n),a={"default-node":dve,"condition-node":cve};return v.jsx("div",{className:"w-full h-full",children:v.jsxs(Xge,{nodes:r,edges:s,nodeTypes:a,onNodesChange:o,fitView:!0,fitViewOptions:{maxZoom:.85},children:[v.jsx(dye,{}),v.jsx(Sye,{pannable:!0,zoomable:!0,maskColor:"#121212",bgColor:"#171717",nodeColor:"#2c2c2c"}),v.jsx(iye,{variant:vo.Dots,gap:12,size:.5})]})})}function hve({workflowId:e}){return v.jsx(fr,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs w-[400px]",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"GET"}),v.jsx("p",{className:"text-mastra-el-5",children:"/api/workflows"})]}),v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"GET"}),v.jsxs("p",{className:"text-mastra-el-5",children:["/api/workflows/",e]})]}),v.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-2",children:[v.jsx("p",{className:"text-mastra-el-3",children:"POST"}),v.jsxs("p",{className:"text-mastra-el-5",children:["/api/workflows/",e,"/execute"]})]})]})})}function pve({runId:e}){const{logs:t,isLoading:n,refetchLogs:r}=nO(e);return v.jsxs(fr,{className:"h-[calc(100vh-126px)] px-4 pb-4 text-xs w-[400px]",children:[v.jsx("div",{className:"flex justify-end sticky top-0 bg-mastra-bg-2 py-2",children:v.jsx(Bt,{variant:"outline",onClick:()=>r(e),children:n?v.jsx(sp,{className:"w-4 h-4 animate-spin"}):v.jsx(sp,{className:"w-4 h-4"})})}),v.jsx("div",{className:"space-y-4",children:t.length===0?v.jsx("p",{className:"text-mastra-el-5",children:"No logs yet"}):t.map(i=>{const o=JSON.parse(i.message);return v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsxs("p",{className:"text-mastra-el-4",children:["[",i.timestamp,"]"]}),v.jsxs("p",{className:"text-mastra-el-5",children:["[",i.level,"]"]})]}),v.jsx("p",{className:"text-mastra-el-5 whitespace-pre-wrap",children:v.jsx("code",{children:JSON.stringify(o,null,2)})})]},i.timestamp)})})]})}function mve({workflowId:e,setRunId:t}){const{isLoading:n,workflow:r}=C4(e),{executeWorkflow:i,isExecutingWorkflow:o}=Mce(),[s,a]=S.useState(null),u=r==null?void 0:r.triggerSchema,c=async h=>{if(!r)return;const p=await i({workflowId:e,input:h});a(p),t(p.runId)};if(n)return v.jsx(fr,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs",children:v.jsx("div",{className:"space-y-4",children:v.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2",children:[v.jsx(Je,{className:"h-3"}),v.jsx(Je,{className:"h-3"})]})})});if(!r)return null;const f=uk(tk(nk(u)));return v.jsx(fr,{className:"h-[calc(100vh-126px)] pt-2 px-4 pb-4 text-xs w-[400px]",children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Input"}),v.jsx(vk,{schema:f,isSubmitLoading:o,onSubmit:h=>{c(h)}})]}),v.jsxs("div",{children:[v.jsx(hn,{variant:"secondary",className:"text-mastra-el-3 px-4",size:"xs",children:"Output"}),v.jsx("div",{className:"flex flex-col gap-2",children:v.jsx(um,{classname:"absolute z-40 top-4 right-4 w-8 h-8 p-0 opacity-0 group-hover:opacity-100 transition-opacity duration-150 ease-in-out",content:JSON.stringify(s??{},null,2)})}),v.jsx(bk,{className:"w-[368px] overflow-x-auto",code:JSON.stringify(s??{},null,2),language:"json"})]})]})})}function YP({workflowId:e}){const[t,n]=S.useState("");return v.jsxs(tO,{defaultValue:"run",children:[v.jsxs(A1,{className:"flex shrink-0 border-b",children:[v.jsx(na,{value:"run",className:"group",children:v.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Run"})}),v.jsx(na,{value:"endpoints",className:"group",children:v.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Endpoints"})}),v.jsx(na,{value:"logs",className:"group",children:v.jsx("p",{className:"text-xs p-3 text-mastra-el-3 group-data-[state=active]:text-mastra-el-5 group-data-[state=active]:border-b-2 group-data-[state=active]:pb-2.5 border-white",children:"Logs"})})]}),v.jsx(ra,{value:"run",children:e?v.jsx(mve,{workflowId:e,setRunId:n}):null}),v.jsx(ra,{value:"endpoints",children:v.jsx(hve,{workflowId:e})}),v.jsx(ra,{value:"logs",children:v.jsx(pve,{runId:t})})]})}function gve(){const{workflowId:e}=tm(),{workflow:t,isLoading:n}=C4(e);if(n)return v.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v.jsx(Er,{title:v.jsx(Je,{className:"h-6 w-[200px]"})}),v.jsxs("main",{className:"flex-1 relative grid grid-cols-[1fr_400px] divide-x",children:[v.jsx("div",{className:"p-4",children:v.jsx(Je,{className:"h-[600px]"})}),v.jsx("div",{className:"flex flex-col",children:v.jsx(YP,{workflowId:e})})]})]});const r=[{label:"Workflows",href:"/workflows"},{label:t==null?void 0:t.name,href:`/workflows/${e}`,isCurrent:!0}];return v.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v.jsx(Er,{title:v.jsx(km,{items:r})}),v.jsxs("main",{className:"flex-1 relative grid grid-cols-[1fr_400px] divide-x",children:[v.jsx(fve,{workflow:t}),v.jsx("div",{className:"flex flex-col",children:v.jsx(YP,{workflowId:e})})]})]})}function yve(){return v.jsx(_B,{children:v.jsx(nB,{children:v.jsxs(ti,{element:v.jsx(d6,{children:v.jsx(eB,{})}),children:[v.jsx(ti,{path:"/",element:v.jsx(J$,{to:"/agents"})}),v.jsx(ti,{path:"/agents",element:v.jsx($6,{})}),v.jsx(ti,{path:"/agents/:agentId",element:v.jsx(fT,{})}),v.jsx(ti,{path:"/agents/:agentId/:threadId",element:v.jsx(fT,{})}),v.jsx(ti,{path:"/tools",element:v.jsx(p6,{})}),v.jsx(ti,{path:"/tools/:agentId/:toolId",element:v.jsx(Tce,{})}),v.jsx(ti,{path:"/tools/all/:toolId",element:v.jsx(Pce,{})}),v.jsx(ti,{path:"/workflows",element:v.jsx(Dce,{})}),v.jsx(ti,{path:"/workflows/:workflowId",element:v.jsx(gve,{})})]})})})}l$.createRoot(document.getElementById("root")).render(v.jsx(S.StrictMode,{children:v.jsx(yve,{})}));export{xX as _,G7 as a,dH as b,ON as c,sH as f,cH as h,u1 as s,J7 as w};